TrinityTuts Tips

Implement Chrome Custom Tab in Android Application

Last updated on April 4th, 2019 at 05:39 pm

In this post I am going to explain to you how we can implement Chrome Custom tab in Android Application If you don’t want to implement Webview in your android application then chrome custom tab is very useful for you and implementation is very simple you just need to pass URL to CustomTabsIntent and ready to go you can even customise your toolbar.

Add dependencies

dependencies {
    ...
    implementation 'com.android.support:customtabs:28.0.0'
}

then add below code in activity class.

String url = "Your Url";
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(mContext, Uri.parse(url));

Hope this tip helps you.