I have an Activity that runs the following code (time and interval are defined):
Intent buzzIntent = new Intent(getBaseContext(), BuzzReceiver.class);
Pendin
Have you tried calling buzzIntent.putExtra()
before you pass buzzIntent
to PendingIntent.getBroadcast()
?
Set flag FILL_IN_DATA
while creating pending intent as below:
PendingIntent pendingIntent = PendingIntent.getBroadcast(getBaseContext(), 0, buzzIntent, Intent.FILL_IN_DATA);
You should receive extras in broadcast receiver after this change.
Try following code
Bundle bundle = intent.getExtras();
int interval= bundle.getInt("interval", -1);
instead of
int interval = intent.getIntExtra("interval", -1);