views:

116

answers:

1

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 to show a dialog from a broadcast receiver -- so how can I show a dialog password entry upon receiving an alert?

A: 

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.

CommonsWare
Hey Mark - thanks for the info - I actually might flip to your wakelock code -- bought all your pdfs last week -- great books; just new to android. For this app it's kind of necessary so might be something the user agrees to...on top of this I'm running a dialog that runs a progbar with a 'while' thread that I'm having issues with - but I'll ask that in another question. t
Garry Schafer