【问题标题】:Activity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42201a30 that was originally bound hereActivity 泄露了原本绑定在这里的 ServiceConnection com.google.android.youtube.player.internal.r$e@42201a30
【发布时间】:2014-01-28 17:54:59
【问题描述】:

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

活动 com.jeslomo.judokatium_2.CinturonActivity 已泄露 服务连接 com.google.android.youtube.player.internal.r$e@42201a30 那是 原定于此

我尝试加载 youtube 的意图:

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

但视频加载正确。

“acty”是我传递给 BaseAdapter 以加载视频的活动。

我该如何解决?

谢谢!!

P.D:对不起,我的英语不好。

【问题讨论】:

    标签: android android-intent youtube


    【解决方案1】:

    请试试这个希望它的工作: 当第二个页面出现时加载 api,然后初始化 YouTube API。不要将您的活动作为上下文提供,而是尝试将应用程序上下文提供给 api。

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

    【讨论】:

    • 嗨,如果我在活动“YouTubePlayer.OnInitializedListener”中实现,虽然他的方法是空的,但不要崩溃!谢谢你的回答!
    猜你喜欢
    • 2015-11-14
    • 2013-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-31
    • 1970-01-01
    • 2013-11-24
    相关资源
    最近更新 更多