Launching Chrome custom tabs example without having launched Chrome beta for the first time

↘锁芯ラ 提交于 2019-12-11 04:08:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!