this is my code for setting alarm:
public void SetAlarm(Context context, int tag, long time){
AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(context, Alarm.class);
i.putExtra("position", tag);
PendingIntent pi = PendingIntent.getBroadcast(context, tag, i, PendingIntent.FLAG_CANCEL_CURRENT);
am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+ time, pi); // Millisec * Second * Minute
}
this is my onRecieve methode:
public void onReceive(final Context context, Intent intent){
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "my wak up lo");
wl.acquire();
position = intent.getIntExtra("position", -1);
new PostManager(context, position);
wl.release();
}
this is working well with emulator. at the same time i set an alarm which will trigger after 24 hour in emulator and real device. the work is done by the emulator well, but not in real device. is this happening for PowerManager.FULL_WAKE_LOCK
or anything else?
i have tried hard but failed find any solution.