add an activity null check at toggling fullscreen

This commit is contained in:
tibbi 2017-02-09 20:51:42 +01:00
parent 3a48b5d41f
commit f728ca2650

View file

@ -159,6 +159,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
}
private fun checkFullscreen() {
if (activity == null)
return
var anim = android.R.anim.fade_in
if (mIsFullscreen) {
anim = android.R.anim.fade_out
@ -167,7 +170,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mSeekBar!!.setOnSeekBarChangeListener(this)
}
AnimationUtils.loadAnimation(context, anim).apply {
AnimationUtils.loadAnimation(activity, anim).apply {
duration = 150
fillAfter = true
mTimeHolder!!.startAnimation(this)