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 :
- when application closed i.e. not running, application alert.
- 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 -
- your
service
should checking flag saysisinside
or not,so time user enters application flag toggled sayingisinside=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
Post a Comment