[Android] Prevent Exception for shitty firmwares

Geoffrey Métais git at videolan.org
Wed Mar 4 13:27:41 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar  4 12:57:48 2015 +0100| [acfcbfe9cde24c01bc74ff163c273f70e573ef6b] | committer: Geoffrey Métais

Prevent Exception for shitty firmwares

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=acfcbfe9cde24c01bc74ff163c273f70e573ef6b
---

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
index cf062bd..91d078b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
@@ -287,6 +287,8 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
             root.addView(bar, 0); // insert at top
         } else {
             ViewGroup root = (ViewGroup) findViewById(android.R.id.content);
+            if (!(root.getChildAt(0) instanceof ListView))
+                return;
             ListView content = (ListView) root.getChildAt(0);
 
             root.removeAllViews();



More information about the Android mailing list