0

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'
James Hyland
  • 45
  • 11
amodkanthe
  • 4,345
  • 6
  • 36
  • 77

1 Answers1

1

Try closing each tab down one-by-one before running application to see which tabs cause application to fail.

James Hyland
  • 45
  • 11