[Android] AudioBrowserFragment: prevent crash if view is not loaded
Edward Wang
git at videolan.org
Wed Jun 11 23:11:27 CEST 2014
vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Wed Jun 11 17:09:10 2014 -0400| [bfed505144d3437aaecfea8351789d43da411da1] | committer: Edward Wang
AudioBrowserFragment: prevent crash if view is not loaded
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=bfed505144d3437aaecfea8351789d43da411da1
---
.../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index d23f640..4ddc5b6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -421,10 +421,12 @@ public class AudioBrowserFragment extends SherlockFragment {
mGenresAdapter.notifyDataSetChanged();
// Refresh the fast scroll data, since SectionIndexer doesn't respect notifyDataSetChanged
int[] lists = { R.id.songs_list, R.id.artists_list, R.id.albums_list, R.id.genres_list };
- for(int r : lists) {
- ListView l = (ListView)getView().findViewById(r);
- l.setFastScrollEnabled(false);
- l.setFastScrollEnabled(true);
+ if(getView() != null) {
+ for(int r : lists) {
+ ListView l = (ListView)getView().findViewById(r);
+ l.setFastScrollEnabled(false);
+ l.setFastScrollEnabled(true);
+ }
}
}
More information about the Android
mailing list