[Android] Do not set OnDragListener before Nougat

Geoffrey Métais git at videolan.org
Tue Jan 16 17:45:03 CET 2018


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

Do not set OnDragListener before Nougat

> https://code.videolan.org/videolan/vlc-android/commit/3d0ca611f8122cffe510d85e556958ac0f069b51
---

 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