My app has repeating tasks will be running every 5-minutes. I try to install same app twice and then the Alarm Manager don't fire to the broadcast for doing the task.
First time install it working all the time, until I reinstall the same version it stop repeating task. This is the problem with Alarm Manager. I don't get it.
This is my code:
Intent intent = new Intent(context, CheckingPriceReceiver.class);
intent.setAction("com.abccompany.trading");
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
REQ_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT);
long mInterval = 300000;
long triggerTime = System.currentTimeMillis() + mInterval;
AlarmManager alarmManager = (AlarmManager)
context.getSystemService(Context.ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, triggerTime, mInterval, pendingIntent);
I don't know how to fix it. Please help!!~~