简体   繁体   中英

What kind of View should I use so to get the Title and the Url of a WebView like in the image below?

WebView with Title and Url and action menu that opens the page into Chrome

So you can see there is a Title "Casi di femminicidio..." and a Url just below it. On the right there is a menu which contains a button that opens the url directly into a chrome tab. I think it would be nice to show to the user the actual url and protocol like that. is it a default view type?

Add this line to your dependencies:

implementation 'com.android.support:customtabs:26.1.0'

and then use:

new CustomTabsIntent
            .Builder()
            .build()
            .launchUrl(this, Uri.parse("http://google.com"));

and if you want to change color of the bar use:

            .setToolbarColor()

more here: https://developer.chrome.com/multidevice/android/customtabs

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM