I am trying to implement custom chrome tabs. I am using Google's default library customtabs.
I referred this tutorial for implementing custom chrome tabs. now as suggested in tutorial, I did my coding something like this.
mCustomTabsServiceConnection = new CustomTabsServiceConnection() {
@Override
public void onCustomTabsServiceConnected(
ComponentName componentName,
CustomTabsClient customTabsClient) {
mCustomTabsClient = customTabsClient;
mCustomTabsClient.warmup(0L);
mCustomTabsSession = mCustomTabsClient.newSession(null);
}
@Override
public void onServiceDisconnected(ComponentName name) {
mCustomTabsClient = null;
}
};
CustomTabsClient.bindCustomTabsService(this, "com.android.chrome",
mCustomTabsServiceConnection);
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(
mCustomTabsSession).setShowTitle(true);
builder.setToolbarColor(getResources().getColor(R.color.purple_main));
builder.setStartAnimations(getApplicationContext(), R.anim.fadein,
R.anim.fadeout);
builder.setExitAnimations(getApplicationContext(), R.anim.fadein,
R.anim.fadeout);
mCustomTabsIntent = builder.build();
and launching custom tabs.
mCustomTabsIntent.launchUrl(TampleDetails.this,
Uri.parse(temple_website));
Now as you see I have bind custom tabs with chrome's package name, still it asks for choosing between Chrome and UC Browser. and it is obvious UC browser doesn't supports Custom tabs.
So my Question is how to restrict Custom tabs to bind only with Chrome Browser?
any help will be appreciated.
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…