My application has a feature of setting reminders.I am creating reminders like this
Intent intent = new Intent(Context,ReminderActivity.class);
intent.putExtra(ResolutionsListActivity.RESOLUTION_OBJECT, resolution);
PendingIntent sender = PendingIntent.getBroadcast(
ComposeResolutionActivity.this,intent,PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
am.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
interval, sender);
resolution --- serializable object.
Here my ReminderActivity class extends broadcast receiver.
I declared my receiver in manifest like this
< receiver android:name="com.webileapps.resolutions.ReminderActivity"
android:process=":remote" />
In my reminderactivity class am catching the triggered alarm and showing the notification.
public class ReminderActivity extends BroadcastReceiver {
private static final String TAG = "ReminderActivity";
@Override
public void onReceive(Context context, Intent intent) {
// Toast.makeText(context, "Alarm set", Toast.LENGTH_SHORT).show();
Resolution resolution = (Resolution) intent
.getSerializableExtra(ResolutionsListActivity.RESOLUTION_OBJECT);
showNotification(context, resolution);
}
I am passing the serializable object so that - whenever users taps on the reminder notification - i can load my activity with that object. However, I'm getting errors like - " Failure filling in extras" whenever alarm triggers.
Can anyone please point out what am I doing wrong?