开发者

Android Notification - Popup dialog box

开发者 https://www.devze.com 2023-03-19 19:47 出处:网络
i am trying to create a dialog box to appear in the middle of the screen when my main program is not in focus and running in background. The purpose of the dialog box is to force the user to take an i

i am trying to create a dialog box to appear in the middle of the screen when my main program is not in focus and running in background. The purpose of the dialog box is to force the user to take an immediate action. I am already开发者_开发问答 using the notification manager to notify the user but i would still like a old school popup dialog box.

Thanks :D


Popping up a dialog from an application running in the background is thought of as bad practice because it may confuse the user, and may annoy the user because you are disrupting the current task s/he is engaged in.

It is advised by the Android developers to use the Android notification system for tasks like these. A guide to create notifications is here: http://developer.android.com/guide/topics/ui/notifiers/notifications.html


Dialogs are created with the Intent of the current activity. Since your app will not be in focus at the time, you cannot create a dialog.

0

精彩评论

暂无评论...
验证码 换一张
取 消