I have a background service running that needs to display an Allow/Deny AlertDialog to the user and get his choice. Roughly, this what I want. In my service, I have a code like this:
void someMethod()
{
boolean allow = showAllowDenyBox();
//Some operations based on the value of allow
}
I want to know how to implement the method showAllowDenyBox(). From this thread, I understand that I have to create an Activity and show the AlertDialog in that Activity. However, once the user selects Allow or Deny, how will I report that choice back to the service? Any help on this would be greatly appreciated.
In short, I want an AlertDialog to be spawned from inside a service and that must be synchronous.