1

Close button of "chrome custom tab" close the entire webview itself. 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.

Kapil
  • 1,790
  • 1
  • 16
  • 32

2 Answers2

2

In my case my application does nothing but open the Chrome Custom Tab, so I was able to do this:

// 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

seanlinsley
  • 3,165
  • 2
  • 25
  • 26
  • If application does something rather than just opening the Chrome Custom Tab, then this little checking on 'onResume()' will be helpful. Refs: http://stackoverflow.com/a/41035189/4784634 – mdrafiqulrabin Mar 01 '17 at 09:09
0

That's not currently possible.

ade
  • 4,056
  • 1
  • 20
  • 25