In my application, user tap a button to go back to home screen by sending a certain intent to startActivity()
But I want to show a Dialog(built by AlertDialogBuilder) after the user goes to home screen. I will call finish() after going to homescreen. How can I do so?
Or in more general, how can I show dialog after calling startActivity to start a activity not belonging to me(now home screen).
Please look over this
PopUp dialog Android from background thread
as per link
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.
What are Android dialog notifications?
A guide to create notifications is here: http://developer.android.com/guide/topics/ui/notifiers/notifications.html