复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18Uri uri = Uri.parse(Url); Intent intent = new Intent(Intent.ACTION_VIEW, uri); PackageManager pm = getPackageManager(); List<ResolveInfo> queryactivities = pm.queryIntentActivities(intent, PackageManager.GET_INTENT_FILTERS); boolean hasChrome = false; for (int i =0;i < queryactivities.size();i++){ if (queryactivities.get(i).activityInfo.packageName.equals("com.android.chrome")){ hasChrome = true; intent.setClassName(queryactivities.get(i).activityInfo.packageName, queryactivities.get(i).activityInfo.name); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } } if (!hasChrome){ HtmlActivity.StartMe(activity,Url); }
或者
复制代码
1
2
3
4
5
6
7
8
9
10
11
12Uri uri = Uri.parse(payUrl); Intent intent = new Intent(Intent.ACTION_VIEW, uri); intent.addCategory(Intent.CATEGORY_BROWSABLE); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_GRANT_READ_URI_PERMISSION); try { intent.setClassName("com.android.chrome", "com.google.android.apps.chrome.IntentDispatcher"); startActivity(intent); } catch (Exception e) { H5Activity.go(this); }
最后
以上就是能干舞蹈最近收集整理的关于从app内跳转chrome浏览器,如果没有就用webView的全部内容,更多相关从app内跳转chrome浏览器内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复