Search code examples
androidmultithreadingandroid-activityforeground

bring Android activity to front from background thread


I have an activity that starts the system browser via Intent. Short before it does that I do a HTTP GET to some other URL. This GET will be answered as soon as the user finishes his task in the browser (logging in using OAuth).

I'd like to be able to close down the browser and / or get my application's activity back to the front.

I do not want to use a WebView because I'd like to avoid the perception that I might be trying to spy on passwords.

Any idea how to solve this? Is it possible at all?

Thanks a bunch!

Daniel


Solution

  • Make sure OAuth opens up URL which is something like yourapp://success

    Next you add a intent filter to handle this custom protocol and address. More details are at http://developer.android.com/guide/topics/intents/intents-filters.html#ifs