Jin
Jin

Reputation: 141

can't go back to the previous activity

This is how my app opens a page in default browser

Intent i = Intent.parseUri("http://www.google.com", Intent.URI_INTENT_SCHEME);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);

Once the browser activity is active, I can't navigate back to my app using back button. It goes the activity before my app. My app/activity is not destroyed though as I can still resume it from the app list. I suspect my activity is 'removed' from the back stack somehow. Please help me debug/fix this. Thanks.

Upvotes: 1

Views: 308

Answers (1)

heloisasim
heloisasim

Reputation: 5016

try to use Intent.ACTION_VIEW

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(myUrl));
startActivity(intent);

Upvotes: 2

Related Questions