The problem
I many cases, applications want to stay connected to the Custom Tabs service after the Custom Tabs is launched. They might want to listen for Custom Tabs callback events or enable a minimized tab to be replaced with a new one when relaunching. The existing code disconnects from the Custom Tabs service when the Activity is stopped, preventing either of those to happen.
The solution
Move binding and unbinding from the Custom Tabs Service to onCreate() / onDestroy(), so the application will stay connected to the service after it is backgrounded, allowing it to continue receiving callbacks and replace a minimized Custom Tab.
The problem I many cases, applications want to stay connected to the Custom Tabs service after the Custom Tabs is launched. They might want to listen for Custom Tabs callback events or enable a minimized tab to be replaced with a new one when relaunching. The existing code disconnects from the Custom Tabs service when the Activity is stopped, preventing either of those to happen.
The solution Move binding and unbinding from the Custom Tabs Service to onCreate() / onDestroy(), so the application will stay connected to the service after it is backgrounded, allowing it to continue receiving callbacks and replace a minimized Custom Tab.