![](/img/trans.png)
[英]What kind of View should I use so to get the Title and the Url of a WebView like in the image below?
[英]I want to open a url using inbuilt Android system web view like the below image
要在 webview 中打開一個 url,只需將 WebView 添加到您的 xml 中。 然后這樣做。
webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.google.com");
不過,您上面的圖像是 chromecustomtab。 所以要做到這一點,你想把它添加到你的應用程序級 build.gradle
compile 'com.android.support:customtabs:23.3.0'
然后打開一個這樣的網址:
String url = ¨https://paul.kinlan.me/¨;
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse(url));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.