[Android] Do not set OnDragListener before Nougat

Geoffrey Métais git at videolan.org
Thu Dec 21 17:28:37 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Dec 21 15:15:45 2017 +0100| [235f769b645a278343d919d46eaf7deb114e6e5b] | committer: Geoffrey Métais

Do not set OnDragListener before Nougat

(cherry picked from commit 3d0ca611f8122cffe510d85e556958ac0f069b51)

> https://code.videolan.org/videolan/vlc-android/commit/235f769b645a278343d919d46eaf7deb114e6e5b
---

 vlc-android/src/org/videolan/vlc/gui/ContentActivity.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java b/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java
index a73eb8b2a..dfe1b2596 100644
--- a/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java
@@ -38,6 +38,7 @@ import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 
+import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.vlc.R;
 import org.videolan.vlc.gui.audio.EqualizerFragment;
 import org.videolan.vlc.gui.browser.ExtensionBrowser;
@@ -53,7 +54,7 @@ public class ContentActivity extends AudioPlayerContainerActivity implements Sea
     @Override
     protected void onPostCreate(@Nullable Bundle savedInstanceState) {
         super.onPostCreate(savedInstanceState);
-        final View view = getWindow().peekDecorView();
+        final View view = AndroidUtil.isNougatOrLater ? getWindow().peekDecorView() : null;
         if (view != null) view.setOnDragListener(new View.OnDragListener() {
             @Override
             public boolean onDrag(View v, DragEvent event) {



More information about the Android mailing list