活动有一个最初这里势必泄露ServiceConnection com.google.android.youtube.player.internal.r$e@42201a30 [英] Activity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42201a30 that was originally bound here

查看:544
本文介绍了活动有一个最初这里势必泄露ServiceConnection com.google.android.youtube.player.internal.r$e@42201a30的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到执行时,我的应用程序的logcat的此消息。

i get this message in the logcat when execute my app.

活动com.jeslomo.judokatium_2.CinturonActivity已泄露
  ServiceConnection
  com.google.android.youtube.player.internal.r$e@42201a30这是
  这里原本势必

Activity com.jeslomo.judokatium_2.CinturonActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42201a30 that was originally bound here

我尝试加载YouTube上的意图:

I try to load a intent of youtube:

意向意图= YouTubeStandalonePlayer.createVideoIntent(ACTY,
  API_KEY,VIDEOID,0,假的,假的);
                 acty.startActivity(意向);

Intent intent = YouTubeStandalonePlayer.createVideoIntent(acty, API_KEY , videoId, 0, false, false); acty.startActivity(intent);

但视频负载正常。

ACTY是我传递给BaseAdapter负载的视频活动。

"acty" is a activity that i passing to BaseAdapter for load the video.

我该如何解决呢?

谢谢!

Pd积:对不起,我的英语不好

P.D: Sorry for my bad english.

推荐答案

请试试这个希望它的工作:
出现的第二个页面时加载的API,并且还再初始化YouTube的API。而不是提供您的活动作为上下文尝试提供应用环境的API。

Please try this hope it's work: load the api when the second page appears, and also then init the YouTube API. Instead of supplying your activity as the context try supplying the application context to the api.

Intent intent = YouTubeStandalonePlayer.createVideoIntent(getApplicationContext(), API_KEY , videoId, 0,  false, false); 
acty.startActivity(intent);

这篇关于活动有一个最初这里势必泄露ServiceConnection com.google.android.youtube.player.internal.r$e@42201a30的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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