External browser with intent, back key problem - Android
I'm working on a开发者_开发百科n app which launches an external browser with this code:
Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));
startActivity(webIntent);
When the user is done with the external browser it takes the user back to the main Activity. The only problem is when the user presses the back it launches the external browser with a blank page, since the startActivity launches an activity which I seem to have no control over.
How do I make the back key ignore the browser, or more importantly how do I finish the activity that the webIntent launches?
If an internal WebView to show the URL is a possibility you can then control the Back button from the Activity.
Without it... i don't think you can "control" the back button behavior.
精彩评论