Android CustomTabs bindCustomTabsService and onCustomTabsServiceConnected never called

368 views Asked by At

I am trying to setup CustomTabs in an activity; however, the bindCustomTabsService method never calls onCustomTabsServiceConnected. What am I missing?

override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.my_activity)


        CustomTabsClient.bindCustomTabsService(this, "com.android.chrome", object: CustomTabsServiceConnection() {
            override fun onServiceDisconnected(p0: ComponentName?) {

            }

            override fun onCustomTabsServiceConnected(
                name: ComponentName,
                client: CustomTabsClient
            ) {
                // this is never called
                log("Client connected")
                mClient = client
                client.warmup(0L)
            }

        })
        ..........
0

There are 0 answers