diff options
author | Martin Fietz <martin.fietz@gmail.com> | 2018-01-14 18:42:26 +0100 |
---|---|---|
committer | Martin Fietz <martin.fietz@gmail.com> | 2018-01-14 18:42:26 +0100 |
commit | e56e3868da4d4440adf6181c5cef0bf1bcf1906e (patch) | |
tree | e6780781888dee334bc006788df96580a6f18087 /app | |
parent | b38d016ec3ff1123de02fbd5556418c1e5a8c5b8 (diff) | |
download | AntennaPod-e56e3868da4d4440adf6181c5cef0bf1bcf1906e.zip |
Variable cannot be final
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index 921b6b6ce..e8821c2e2 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -7,6 +7,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.support.v4.view.WindowCompat; +import android.support.v7.app.ActionBar; import android.util.Log; import android.util.Pair; import android.view.MotionEvent; @@ -353,20 +354,23 @@ public class VideoplayerActivity extends MediaplayerActivity { private static final int DELAY = 2500; - private final WeakReference<VideoplayerActivity> activity; + private WeakReference<VideoplayerActivity> activity; - public VideoControlsHider(VideoplayerActivity activity) { + VideoControlsHider(VideoplayerActivity activity) { this.activity = new WeakReference<>(activity); } private final Runnable hideVideoControls = () -> { - VideoplayerActivity vpa = activity.get(); + VideoplayerActivity vpa = activity != null ? activity.get() : null; if(vpa == null) { return; } if (vpa.videoControlsShowing) { Log.d(TAG, "Hiding video controls"); - vpa.getSupportActionBar().hide(); + ActionBar actionBar = vpa.getSupportActionBar(); + if(actionBar != null) { + actionBar.hide(); + } vpa.hideVideoControls(); vpa.videoControlsShowing = false; } @@ -376,7 +380,7 @@ public class VideoplayerActivity extends MediaplayerActivity { this.postDelayed(hideVideoControls, DELAY); } - public void stop() { + void stop() { this.removeCallbacks(hideVideoControls); } |