com.google.android.youtube意图未找到 [英] com.google.android.youtube intent not found

查看:172
本文介绍了com.google.android.youtube意图未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 字符串VIDEOID =dD40VXFkusw;
INT VIDEO_APP = 5551;
意图videoClient =新意图(Intent.ACTION_VIEW);
videoClient.setData(Uri.parse(http://m.youtube.com/watch?v=+ VIDEOID));
videoClient.setClassName(com.google.android.youtube,com.google.android.youtube.PlayerActivity);
              startActivityForResult(videoClient,VIDEO_APP);

这用来工作为我展现在原生播放YouTube视频,但现在我得到一个ActivityNotFoundException。这是为什么?

 (9月6日至10日:23:33.949:ERROR / AndroidRuntime(27869):android.content.ActivityNotFoundException:无法找到明确的活动类{com.google.android.youtube/ com.google.android.youtube.PlayerActivity};你宣布你的Andr​​oidManifest.xml这个活动?


解决方案

在项目申报com.google.android.youtube活动的Andr​​oidManifest.xml。

另外安装YouTube应用在设备/模拟器。

如果YouTube应用程序无法使用您的设备,那么这种类型的错误将会产生。

String videoId = "dD40VXFkusw";
int VIDEO_APP = 5551;
Intent videoClient = new Intent(Intent.ACTION_VIEW);
videoClient.setData(Uri.parse("http://m.youtube.com/watch?v="+videoId));
videoClient.setClassName("com.google.android.youtube","com.google.android.youtube.PlayerActivity");
              startActivityForResult(videoClient, VIDEO_APP);

This used to work for me to show a youtube video in the native player but now I get an ActivityNotFoundException. Why is this?

(06-10 09:23:33.949: ERROR/AndroidRuntime(27869): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.google.android.youtube/com.google.android.youtube.PlayerActivity}; have you declared this activity in your AndroidManifest.xml?
)

解决方案

Declared "com.google.android.youtube" activity in your project AndroidManifest.xml.

Also install youtube app in your device/emulator.

If youtube app is not available in your device, Then this type of error will be generated.

这篇关于com.google.android.youtube意图未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆