novoda / simple-chrome-custom-tabs

Easy integration of Chrome Custom Tabs into your project. Just connect it to your activity, and navigate to the external website styling your tab as you wish.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Runtime crash in SimpleChromeCustomTabs

vidhis88 opened this issue · comments

Caused by android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=Http: pkg=com.android.chrome (has extras) }
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1904)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1624)
    at android.app.Activity.startActivityForResult(Activity.java:3761)
    at android.app.Activity.startActivity(Activity.java:4028)
    at android.support.customtabs.CustomTabsIntent.launchUrl(CustomTabsIntent.java:163)
    at com.novoda.simplechromecustomtabs.navigation.SimpleChromeCustomTabsWebNavigator.navigateTo(SimpleChromeCustomTabsWebNavigator.java:37)

The line 37 executes when the the connected condition is true for the SimpleChromeCustomTabsWebNavigator class so it is contradictory to not find the activity.
Connection is established in the onResume() and disconnected in onPause() of the base activity.

Crash stats:
Devices affected -
Samsung 59%
HTC 19%
LG 11%
Others 11%

OS -
Lollipop 77%
Marshmallow 18%
Kitkat 4 5%

So pretty much affects all Android devices.

I think there is a problem in your code. Given the stacktrace you are pasting:

 No Activity found to handle Intent { act=android.intent.action.VIEW dat=Http: pkg=com.android.chrome (has extras) }

It seems that you are instructing SimpleChromeCustomTabs to navigate to Http:. Make sure you provide a correct Uri to navigate to.

As an additional note the following code will crash for you with exactly the same stacktrace:

Intent intent = new Intent(Intent.ACTION_VIEW).setData(url);
startActivity(intent);

Where url is your desired Uri, in your example Http:

Closing this issue.