Making sure that opening app from widget does initialization
I have a widget, and whenever it is clicked, my app opens. I want to make
sure it loads the correct item (the item that the widget shows). My
current code for setting up the intent looks like this:
intent.putExtra(NuggetActivity.DAY_NUMBER, todayLong);
intent.putExtra(FROM_WIDGET, true);
PendingIntent pendingIntent = PendingIntent.getActivity(context, (int)
todayLong, intent, PendingIntent.FLAG_UPDATE_CURRENT);
views.setOnClickPendingIntent(R.id.container,pendingIntent);
The app loads fine when the app is loaded from onCreate() onwards, but not
when the app resumed (through onResume()).
Is there some flag I can set in my intent to make sure that onCreate()
gets called, or is there some other way to solve this?
No comments:
Post a Comment