Tabby icon indicating copy to clipboard operation
Tabby copied to clipboard

mayLaunchUrl optimization never performed

Open ekchang opened this issue 9 years ago • 0 comments

In MainActivity, CustomTabActivityHelper.mayLaunchUrl can't be called during onCreate: neither the client or session are created because their creation happens after onCustomTabsServiceConnected callback, which is called in onStart.

The CustomTabsSession.mayLaunchUrl optimization needs to be called after the service connected callback (where warmup occurs).

I address this in my fix for CustomTabActivityHelper which changes mayLaunchUrl to set the Uri and Bundles as field variables and session.mayLaunchUrl is called after receiving the service connected callback. This allows you to keep MainActivity the way it is and let you set the preferred URL without waiting for the service callback within the Activity.

ekchang avatar Sep 30 '15 16:09 ekchang