简体   繁体   English

Chrome 自定义标签的关闭按钮功能覆盖

[英]Chrome custom tabs's close button feature override

Close button of "chrome custom tab" close the entire webview itself. “chrome 自定义选项卡”的关闭按钮关闭整个 web 视图本身。 However I want it to override its behaviour to work as hardware back button behaviour so that user can go back to previous page of web instead of closing webview.但是我希望它覆盖它的行为以作为硬件后退按钮行为,以便用户可以返回到网页的上一页而不是关闭网页视图。

I read so many posts and blogs but i could not get find any solution.我阅读了很多帖子和博客,但找不到任何解决方案。 I have found the solution to change the close button icon.我找到了更改关闭按钮图标的解决方案。

In my case my application does nothing but open the Chrome Custom Tab, so I was able to do this:在我的情况下,我的应用程序除了打开 Chrome 自定义选项卡什么都不做,所以我能够做到这一点:

// This is called on boot, and when the Chrome Custom Tab's X button in the top left is clicked.
protected void onResume() {
    super.onResume();
    tryLaunch();
}

where tryLaunch launches Chrome tryLaunchtryLaunch启动 Chrome

这是目前不可能的。

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

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