Reputation: 2749
I have an alarm manager to check if my activity needs to be updated every 30 minutes or so. I want to send from the alarmManager to my running activity a message to it be reloaded. How i would do so? I tryied using startActivity from within the alarmManager but i was unsuccessful.
Upvotes: 0
Views: 148
Reputation: 1513
Are you familiar with Activity's onNewIntent method? In your activity class you should be able to do something like this:
@Override
protected void onNewIntent(Intent i){
refresh();
}
You could also pack some extra data into the PendingIntent you raise with AlarmManager and check it from onNewIntent if you need more logic.
Upvotes: 1