I am developing one application in Android. My application has one service. My service is always running in background. My background service keep monitoring of region define by user.
Now when user go out range my application give alert to user. Now my problem is below :
- When my application is closed i.e. not running, then my application get alert.
- When my application is running then sometimes it get alert and some times not.
Below is the code i.e. activity that will load alert for when user go out of range.
//SecuRemote.LOG("current activity context" + SecuRemote.currentActivityContext);
Intent i = 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 some good response... Regards,