Android Question How to display urgent error message no matter what activity is currently displayed?

JohnC

Expert
Licensed User
Longtime User
I have any app that uses a background service. And sometimes the service will encounter an error. When this happens it is VERY important that I interrupt what the user is doing and display the error to the user and they have to acknowledge the error before they can resume their activity in the app.

I can't use Toastmessage because that disappears after a few seconds.

So, what is the recommended way to display a message (such as a msgbox) to the user no matter what activity they are currently using?
 

DonManfred

Expert
Licensed User
Longtime User
You can NOT show a Alert from a Service. You MUST open one of your Activities to show it.
You can use a special Activity for it ifd you want.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
So, would I then do a CallSubDelay from the service to display this "special" activity that is dedicated to just displaying these error messages?

If so, then will this "special" activity be display relatively immediately if the user is currently using the app (app in foreground) but the user is displaying a different activity?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
So, would I then do a CallSubDelay from the service to display this "special" activity that is dedicated to just displaying these error messages?
yes
but the user is displaying a different activity?
you know which activities are available and you can check if they are activer or not.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
I'll give it a try. Thanks.
 
Upvote 0
Top