[Android] Fix a NPE with performLongClick
Ludovic Fauvet
git at videolan.org
Mon Apr 14 17:07:38 CEST 2014
vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Mon Apr 14 16:57:26 2014 +0200| [10b0263c576ef6f19f20b122d9b69df671b4b155] | committer: Ludovic Fauvet
Fix a NPE with performLongClick
Prevent performLongClick event to be dispatched after the fragment is
detached and thus getActivity returning null.
A similar result can be achieved by checking if getActivity is null
within OnItemLongClickListener.
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=10b0263c576ef6f19f20b122d9b69df671b4b155
---
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index 4c6101a..54e2190 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -257,6 +257,7 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
@Override
public void onPause() {
super.onPause();
+ getView().cancelLongPress();
}
@Override
More information about the Android
mailing list