Reputation: 4530
Following is my code to launch chrome custom tab from android.
try {
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(ContextCompat.getColor(context, R.color.appthemecolor));
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(context, Uri.parse(url));
} catch (ActivityNotFoundException e) {
e.printStackTrace();
Intent intent = new Intent(context, WebviewActivity.class);
intent.putExtra(WebviewActivity.EXTRA_URL, url);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(intent);
} catch (Exception e) {
}
If I launch chrome custom tabs 3 to 4 times it kills my application and launches new tab
This issue is occurring on Jelly Bean devices only
I am using following support library version
compile 'com.android.support:customtabs:25.3.1'
Upvotes: 0
Views: 862
Reputation: 45
Try closing each tab down one-by-one before running application to see which tabs cause application to fail.
Upvotes: 1