My MainActicity
starts RefreshService
with a Intent
which has a boolean
extra called isNextWeek
.
My
I think you need to update the Intent
when you receive a new one by overriding onNewIntent(Intent)
in your Activity. Add the following to your Activity:
@Override
public void onNewIntent(Intent newIntent) {
this.setIntent(newIntent);
// Now getIntent() returns the updated Intent
isNextWeek = getIntent().getBooleanExtra(IS_NEXT_WEEK, false);
}
Edit:
This is needed only if your Activity has already been started when the intent is received. If your activity is started (and not just resumed) by the intent, then the problem is elsewhere and my suggestion may not fix it.