[Android] Util: hack to allow missing app resources build

Edward Wang git at videolan.org
Tue Mar 26 05:02:00 CET 2013


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Mon Mar 25 22:11:28 2013 -0400| [60209c35b41cb9047941da229b387a6178943f8d] | committer: Edward Wang

Util: hack to allow missing app resources build

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

 vlc-android/src/org/videolan/vlc/Util.java           |    6 ++++++
 vlc-android/src/org/videolan/vlc/VLCApplication.java |    1 +
 2 files changed, 7 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index 6a9dac2..5753371 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -273,6 +273,12 @@ public class Util {
         // If already checked return cached result
         if(errorMsg != null) return isCompatible;
 
+        if(VLCApplication.getAppResources() == null) {
+            Log.e("WARNING: Unable to get app resources; cannot check device ABI!");
+            Log.e("WARNING: Cannot guarantee correct ABI for this build (may crash)!");
+            return true;
+        }
+
         Properties properties = new Properties();
         try {
             properties.load(new ByteArrayInputStream(Util.readAsset("env.txt", "").getBytes("UTF-8")));
diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index bf7bd8e..f11ae72 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -86,6 +86,7 @@ public class VLCApplication extends Application {
      */
     public static Resources getAppResources()
     {
+        if(instance == null) return null;
         return instance.getResources();
     }
 }



More information about the Android mailing list