I use this code to load YouTube Videos in an activity that supports it (normally a browser):
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=" + videoId));
context.startActivity(i);
I received this anonymous track trace, I can’t work out how this has happened. Does this mean that the device doesn’t know what activity it needs to use to handle ‘http’ protocol? (i.e. no browser?)
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://www.youtube.com/watch?v=xxxxxx }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
at android.app.Activity.startActivityForResult(Activity.java:3190)
at android.app.Activity.startActivity(Activity.java:3297)
at com.sprogcoder.basetube.d.c.a(Unknown Source)
at com.sprogcoder.basetube.f.b.onItemClick(Unknown Source)
at android.widget.AdapterView.performItemClick(AdapterView.java:292)
at android.widget.Gallery.onSingleTapUp(Gallery.java:960)
at android.view.GestureDetector.onTouchEvent(GestureDetector.java:568)
at android.widget.Gallery.onTouchEvent(Gallery.java:937)
at android.view.View.dispatchTouchEvent(View.java:5546)
Thanks!
What if you add a valid video Id ? like “AOsgv_X_cV8”
but I think you are tryin to do this on the emulator, thats the reason for what you are getting this error message.
Use the youtube app.