[Android] VLCApplication: avoid AssertionError in locale setting
Edward Wang
git at videolan.org
Sat May 25 17:53:59 CEST 2013
vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sat May 25 11:39:37 2013 -0400| [e1de1611fdb4640553afb8af770af50525b318b8] | committer: Edward Wang
VLCApplication: avoid AssertionError in locale setting
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=e1de1611fdb4640553afb8af770af50525b318b8
---
vlc-android/src/org/videolan/vlc/VLCApplication.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index f11ae72..f0f5531 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -50,6 +50,13 @@ public class VLCApplication extends Application {
} else if(p.startsWith("zh")) {
locale = Locale.CHINA;
} else {
+ /**
+ * Avoid a crash of
+ * java.lang.AssertionError: couldn't initialize LocaleData for locale
+ * if the user enters nonsensical region codes.
+ */
+ if(p.contains("-"))
+ p = p.substring(0, p.indexOf('-'));
locale = new Locale(p);
}
Locale.setDefault(locale);
More information about the Android
mailing list