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

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -