android: show notification under certain conditions -


i have searched information under topic while. think want common. i'm creating word learning app. want show piece of notification in notification center when there words should reviewed. it's not based on time. want is:

if (isneedreview()) {     show notification } 

i think need alarmmanager, it's based on time. know how handle this? need up? advice appreciated, thank you.

one option use service.

you first use alarmmanager start service on set schedule (say every half hour). service perform logic necessary check if word needs review , show notification appropriate.

a basic service performs functionality this:

public class reviewcheckservice extends intentservice {     public reviewcheckservice() {}      @override     protected void onhandleintent(intent intent) {         if (isneedreview()) {             shownotification();         }     } } 

Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -