问题
I have just begun experimenting with chrome custom tabs and faced this small problem. While I set up the environment to run the Chrome custom tabs example I downloaded Chrome beta on my device. However, when I ran the example, it wouldn't work.
I put up a couple of breakpoints and everything seemed to be working and, most importantly, the program could find a package that supported custom tabs with:
String packageName = CustomTabsHelper.getPackageNameToUse(this);
'packageName' was set to chrome beta but none of the callbacks were called (onCustomTabsServiceConnected or onServiceDisconnected).
I solved this problem by running Chrome Beta and performing a couple of setup operations. After that, I ran the example again and it worked. It seems to be a kind of bug... Is this behaviour expected?
回答1:
This is expected behavior. When Chrome displays anything to the user, it asks to accept the terms of use first. After accepting the TOS, the webpage should be displayed, and the app gets the ability to bind to the service.
来源:https://stackoverflow.com/questions/32190762/launching-chrome-custom-tabs-example-without-having-launched-chrome-beta-for-the