Loading Dialog box in android -


i developing 1 application in android. application has 1 service. service running in background. background service keep monitoring of region define user.

now when user go out range application give alert user. problem below :

  1. when application closed i.e. not running, application alert.
  2. when application running alert , times not.

below code i.e. activity load alert when user go out of range.

//securemote.log("current activity context" + securemote.currentactivitycontext); intent = new intent(context, showalertdialog.class); i.addflags(intent.flag_activity_new_task | intent.flag_activity_single_top); i.putextra("msg",msg); if(status){     i.putextra("status","true");     if(devname != null)         i.putextra("devname",devname); } else     i.putextra("status","false");     securemote.log("start activity showalertdialog" + context);     context.startactivity(i); 

looking response... regards,

the problem might in programming logic -

  1. your service should checking flag says isinside or not,so time user enters application flag toggled saying isinside=true , onpause or on ondestroy whatever think gonna serve purpose should toggle flag

//service part , dialog showing

so in service checking flag,as checks isinside=false raises alert using code mentioned above....i recommend show above activity(the alert activity) dialog putting theme attribute of activity dialog ....

android:theme="@android:style/theme.dialog"

i hope helps you.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -