【发布时间】:2019-02-21 18:47:53
【问题描述】:
我正在使用Custom Tabs 启动web view。
问题是,如果我禁用chrome,它会在一个没有任何按钮的活动中打开URL。
如果您的用户设备上没有安装 chrome,我想启动 Web Browser,如果有 chrome,我想启动 custom tab。
这是我启动Custom Tabs的代码
CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
.addDefaultShareMenuItem()
.setShowTitle(true)
.build();
// This is optional but recommended
CustomTabsHelper.addKeepAliveExtra(eContext, customTabsIntent.intent);
// This is where the magic happens...
CustomTabsHelper.openCustomTab(eContext, customTabsIntent,
Uri.parse(url),
new WebViewFallback());
【问题讨论】:
标签: android performance android-layout android-webview android-customtabs