Android Displaying Web Page using Intent

2019-06-28 00:23发布

I am using below code to display web page

Uri uri = Uri.parse("http://myurl");
 Intent intent = new Intent(Intent.ACTION_VIEW, uri);
 startActivity(intent);

but when i click the back button to navigate to previous it is not loading the previous page instead it loads the same page

This happens with some urls not all

Why does this happens? Any Solution???

标签: android
1条回答
男人必须洒脱
2楼-- · 2019-06-28 01:24

What URL are you hitting? This can definitely happen if you try to send users to sites like Twitter that use a redirect-to-self scheme for SEO/AJAX purposes or to send the user to a mobile page. In a regular browser it forces you to hit back twice in rapid succession to get back to the original page. Same for Android.

If that is what is happening here the solution is, I'm afraid, to not send users to pages that do that and/or tell the webmasters at the offending sites about the problem.

查看更多
登录 后发表回答