Im working with Android 2.1, RoboGuice 1.1 and Guice 2.0 (without aop).
My app has a background thread that gets started in the onCreate method of the Activity which connects to a server and might need the user to provide credentials for logging in.
At first I found the PopupWindow in the API but I read in this post that it shouldn't be used for that.
So I tried to inject my Activity into my background thread and to open a Dialog in a Runnable passed to Activity.runOnUIThread(Runnable r) but unfortunately roboguice is creating a new instance of my activity when injecting it into my background thread.
I now assume the correct way of implementing a Login-Dialog would be to send an Intent to my activity and let it show the Dialog. Furthermore I assume that the Activity needs to send an Intent (containing the credentials) back to the background thread.
Is this correct or is there a more elegant way of doing that?
In this post I found how to register a receiver for the Intent. But on which Activity instance should I call registerReceiver within the background thread?
Best regards