gpt4 book ai didi

android - OpenYouTubePlayerActivity.class错误不显示视频

转载 作者:行者123 更新时间:2023-12-03 06:35:12 25 4
gpt4 key购买 nike

嗨,我正在尝试使用我从其他应用程序中使用的代码,也许因为ICS,所以它不起作用。

我使用OpenYouTubePlayerActivity-1.2 lib在自己的应用程序上显示视频,而不是打开Youtube应用程序。为此,我仅使用以下一个:

    String url = "http://www.youtube.com/watch?v=xb1BL_HNvZY";
Uri uri = Uri.parse(url);
String videoId = uri.getQueryParameter("v");

Intent videoIntent = new Intent(null, Uri.parse("ytv://" + videoId),getActivity(),OpenYouTubePlayerActivity.class);

我尝试使用不带//的“ytv:nasdasd”示例,但不进行修复。

错误得到:
02-21 23:08:39.293: E/AndroidRuntime(13304): FATAL EXCEPTION: main
02-21 23:08:39.293: E/AndroidRuntime(13304): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.os.Handler.dispatchMessage(Handler.java:99)
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.os.Looper.loop(Looper.java:137)
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.app.ActivityThread.main(ActivityThread.java:5039)
02-21 23:08:39.293: E/AndroidRuntime(13304): at java.lang.reflect.Method.invokeNative(Native Method)
02-21 23:08:39.293: E/AndroidRuntime(13304): at java.lang.reflect.Method.invoke(Method.java:511)
02-21 23:08:39.293: E/AndroidRuntime(13304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-21 23:08:39.293: E/AndroidRuntime(13304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-21 23:08:39.293: E/AndroidRuntime(13304): at dalvik.system.NativeStart.main(Native Method)
02-21 23:08:39.293: E/AndroidRuntime(13304): Caused by: java.lang.NullPointerException
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:379)
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.app.LoadedApk.getClassLoader(LoadedApk.java:322)
02-21 23:08:39.293: E/AndroidRuntime(13304): at android.app.LoadedApk.makeApplication(LoadedApk.java:496)
02-21 23:08:39.293: E/AndroidRuntime(13304): ... 11 more

最佳答案

最后,我使用新的Youtube API

关于android - OpenYouTubePlayerActivity.class错误不显示视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15013645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com