Note: This question regards Gingerbread running on a crespo4g target.

I'm modifying the Keyguard and associated security Settings to include
an external authentication option to unlock the screen. I'd like to
use a ProgressDialog while attempting to validate the login, but it
does not appear to work in the Keyguard. I'm basing my new code in
part on the AccountUnlockScreen.java code. I noticed that the existing
AccountUnlockScreen.java seems to call a ProgressDialog as well, but
it never appears when the stock AccountUnlockScreen is run.

I've done my prototyping in a standard Activity just to figure out the
process I want to use. In that activity, I use an AsyncTask to display
the ProgressDialog spinner and run the long-ish external
authentication. It works perfectly there, just as I'd expect, but does
not work the same in the Keyguard. The code will compile, but I get a
runtime error on the ProgressDialog show() function stating: "Unable
to add window -- token null is not for an application". I then just
tried to no-op the login and put the ProgressDialog with a
Thread.sleep without using AsyncTask. The dialog never appears and no
errors occur to explain why.

When I search for answers on Google, I see other people have used the
wrong context (getActivityContext() or something similar) will get
this error. In my case, I'm using the context passed into the class
which works correctly when launching a standard AlertDialog message.

Has anyone got a suggestion on where to go from here? Do I need to
dummy up my own dialog or draw it using layout primitives and hide/
show it? Thanks in advance.

Tony

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to