如何在Chrome自定义标签中使用getUrl()

时间:2018-11-22 16:28:46

标签: android android-fragments webview

im使用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));

1 个答案:

答案 0 :(得分:0)

URL应该像在URL之前添加https的“ https://www.google.co/