Sam
Sam

Reputation: 2091

No Activity found to handle https:// Intent

Full error is this

 android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat= https://www.youtube.com/watch?v=xKJmEC5ieOk }

No idea what's going on. I've looked at the other S/O posts and the url looks formatted correctly, http:// is lower case, and it's present.

However, if I insert it as a string literal, instead of the url String variable it launches in the browser correctly. Mad. I print the url in logs and there is no weird punctuation messing it up. Can't understand it.

This is where it throws the exception:

    @Override
public void onClick(String url) {

    Log.v(TAG, "launching intent: " + url);
    Intent mIntent = new Intent(Intent.ACTION_VIEW);
    mIntent.setData(Uri.parse(url));
    startActivity(mIntent);
}

What am I missing? Love some help.

Upvotes: 4

Views: 718

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006674

You appear to have a leading space in front of the scheme.

dat= https://www.youtube.com/watch?v=xKJmEC5ieOk should be dat=https://www.youtube.com/watch?v=xKJmEC5ieOk

Upvotes: 5

Related Questions