我们已经使用Youtubeapi for android,但是快速关闭并使用youtube播放器和youtube播放器视图打开相同的活动存在问题.此问题也出现在示例应用程序中,当我尝试打开fulscreen活动时(不单击全屏按钮),然后使用后退按钮一次又一次地关闭活动.Yutube应用程序崩溃.
10-11 15:14:53.313: E/ActivityThread(22537): Activity com.example.myvideo.FullscreenDemoActivity has leaked ServiceConnection
com.google.android.youtube.player.internal.r$e@46095818 that was originally bound here
Run Code Online (Sandbox Code Playgroud)
我试图覆盖OnStop以释放播放器但没有正面结果.请有人帮忙.
Fulscreen活动修改 - 原始和此之间几行差异.谢谢!
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import com.google.android.youtube.player.YouTubePlayer;
import com.google.android.youtube.player.YouTubePlayer.PlayerStyle;
import com.google.android.youtube.player.YouTubePlayerView;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
/**
* Sample activity showing how to properly enable custom fullscreen behavior.
* <p>
* This is the preferred way of handling fullscreen …Run Code Online (Sandbox Code Playgroud)