Android Broadcast Receiver showing a dialog?

前端 未结 3 489
南笙
南笙 2021-01-22 03:39

I\'ve got an app that responds to an Alert - and I really need to show an alert with a password entry before going on to the next screen; the trouble is I don\'t seem to be able

3条回答
  •  无人共我
    2021-01-22 04:11

    Create an activity, using Theme.Dialog, and call startActivity() to open it. While you cannot use a "real" Dialog, you can create a UI that looks like a Dialog.

    Bear in mind that popping up an activity based on a broadcast may greatly irritate some users, who might not appreciate your dialog appearing in the middle of their game or text message conversation or whatever. You may wish to consider actually raising a Notification, then displaying the dialog when they open up that Notification.

提交回复
热议问题