Android cannot pass intent extras though AlarmManager

UPDATE: Please see Vincent Hiribarren’s solution Old Answer… Haresh’s code is not the complete answer… I used a Bundle and I tried without Bundle but I got null’s either way when I attempting to obtain the strings from the extra’s !! The exact problem, in your code, is with the PendingIntent ! This is wrong … Read more

Android AlarmManager – RTC_WAKEUP vs ELAPSED_REALTIME_WAKEUP

AlarmManager.ELAPSED_REALTIME_WAKEUP type is used to trigger the alarm since boot time: alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, 600000, pendingIntent); will actually make the alarm go off 10 min after the device boots. There is a timer that starts running when the device boots up to measure the uptime of the device and this is the type that triggers your alarm … Read more

How to set multiple alarms using alarm manager in android

You need to use different Broadcast id’s for the pending intents. Something like this: Intent intent = new Intent(load.this, AlarmReceiver.class); final int id = (int) System.currentTimeMillis(); PendingIntent appIntent = PendingIntent.getBroadcast(this, id, intent, PendingIntent.FLAG_ONE_SHOT); Using the system time should be a unique identifier for every pending intent you fire.

does Alarm Manager persist even after reboot?

A simple answer would be NO. But yes you can achieve this by creating a BroadCastReceiver which will start the Alarm while booting completes of the device. Use <action android:name=”android.intent.action.BOOT_COMPLETED” /> for trapping boot activity in BroadCastReceiver class. You need to add above line in AndroidManifest.xml as follows, <receiver android:name=”.AutoStartUp” android:enabled=”true” android:exported=”false” android:permission=”android.permission.RECEIVE_BOOT_COMPLETED”> <intent-filter> <action … Read more