简体   繁体   English

Android WebView Wrapper(应用程序内浏览器)行为

[英]Android WebView Wrapper (In-App Browser) behavior

On recent versions of Android, opening a link from Google Search it opens on a wrapped version of the Chrome within Google Search app and it offers a option on the menu to 'open with Chrome'. 在Android的最新版本中,打开Goog​​le搜索的链接会在Google搜索应用中的Chrome浏览器上打开,并在菜单上提供“使用Chrome打开”的选项。 This common pattern is also seen on other apps like Facebook, Twitter, etc. So basically it opens the link on a 'WebView wrapper' within the app instead of opening the Browser app. 这种常见模式也出现在Facebook,Twitter等其他应用程序上。因此,基本上它会在应用程序中的“WebView包装器”上打开链接,而不是打开浏览器应用程序。

An interesting thing is found on the one from Google Search, that when you click on the 'open with Chrome' it plays a very smooth transition to Chrome, like if it would get transformed into Chrome. 谷歌搜索的一个有趣的事情是,当你点击“打开Chrome”时,它可以非常平稳地过渡到Chrome,就好像它会转变为Chrome一样。

Is there any sample or library that kinda helps or wraps this behavior? 是否有任何样本或库有助于或包装这种行为? Or an 'in-app browser' that wraps this activity behavior. 或者是一个包含此活动行为的“应用内浏览器”。

Your probably looking for Chrome Custom Tabs as Morrison Chang already mentioned. 您可能正在寻找Chrome自定义标签,正如Morrison Chang已经提到过的那样。

Add compile 'com.android.support:customtabs:26.0.2' to your build.gradle file. compile 'com.android.support:customtabs:26.0.2'添加到build.gradle文件中。

You can open a new tab like this: 您可以像这样打开一个新标签:

CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse("https://www.example.com"));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 PHP / Javascript 检测应用内浏览器 (WebView) - Detect in-app browser (WebView) with PHP / Javascript 如何在 Android 的 WebView 的外部浏览器和应用程序内打开链接 - How to open links both in an external browser and in-app within a WebView for Android 从Android上的应用内浏览器重定向到应用 - Redirect to app from in-app browser on Android 网页无法在Android应用内浏览器中正确加载 - Webpage is not loading correctly on In-App browser Android Android / iOS 应用内浏览器上的证书固定 - Certificate Pinning on Android / iOS in-App Browser 可以退出Android应用内浏览器吗? - Can an Android in-app browser be exited? 应用内付款对话框下的Android WebView / XWalkView空白 - Android WebView/XWalkView blank under In-App Payment dialog twitter for android应用程序内浏览器禁用打开本机应用程序的链接 - twitter for android in-app browser disables opening the link with native app android web wrapper app的webview中如何正确处理注销? - How to properly deal with logout in the webview of android web wrapper app? 从 Android 上的应用内浏览器重定向到 Chrome 的最佳方式? - The best way of redirecting to Chrome from in-app browser on Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM