PopUp dialog Android from background thread

If you’re trying to ask how to show a dialog when your activity is not the focused activity on the user’s phone then try using Notifications instead. Popping up a dialog over a different application interrupts the user when they may be doing something else. From the Android UI guidelines:

Use the notification system — don’t
use dialog boxes in place of
notifications

If your background service needs to
notify a user, use the standard
notification system — don’t use a
dialog or toast to notify them. A
dialog or toast would immediately take
focus and interrupt the user, taking
focus away from what they were doing:
the user could be in the middle of
typing text the moment the dialog
appears and could accidentally act on
the dialog. Users are used to dealing
with notifications and can pull down
the notification shade at their
convenience to respond to your
message.

A guide to create notifications is here: http://developer.android.com/guide/topics/ui/notifiers/notifications.html

Leave a Comment