android - 如何在 Chrome 自定义标签中使用 getUrl()
问题描述
我正在使用 chrome 自定义标签(webview),但 getUrl() 和 getTitle() 函数不起作用。这个怎么做?
final CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();
intentBuilder.setToolbarColor(ContextCompat.getColor(getActivity(), R.color.colorPrimary));
intentBuilder.setShowTitle(false);
//intentBuilder.setSecondaryToolbarColor(ContextCompat.getColor(getActivity(), R.color.colorPrimaryDark));
intentBuilder.setExitAnimations(getActivity(), android.R.anim.slide_in_left, android.R.anim.slide_out_right);
CustomTabsIntent customTabsIntent = intentBuilder.build();
customTabsIntent.launchUrl(getActivity(), Uri.parse(urll));
解决方案
URL 应该是这样的“ https://www.google.co/ ”在 url 之前添加 https
推荐阅读
- azure - 带有表存储和 SignalR 的 Azure 函数应用 REST Api
- json - TypeScript 的 JSON.stringify 包括隐藏字段,但不包括公共接口的值
- go - go中的[]int{}和[]int有什么区别?
- html - 内容宽度在打印屏幕中不起作用
- python - 只要按住射击按钮,如何射击多发子弹
- php - LAMP Stack 无法正确读取 mysql 数据库,但无法正确插入。功能“成功”没有错误,但数据库不更新
- continuous-integration - GitHub Workflow 中的 `github.event` 有哪些属性?
- django - http流实际上是由http chunk实现的吗?
- jquery - 替换输入jQuery的先前值
- typescript - 打字稿“静态导入”?