[Android] Small VLCApplication refactoring

Andrey Khalyavin git at videolan.org
Fri Dec 5 04:01:53 CET 2014


vlc-ports/android | branch: master | Andrey Khalyavin <halyavin at google.com> | Thu Dec  4 22:48:39 2014 +0400| [df4948472cfe837287d2e1441ac8f330c9257c7e] | committer: Edward Wang

Small VLCApplication refactoring

Application.getResources() is equivalent to getBaseContext().getResources().
Neither of 5 references to VLCApplication.getAppResources() check its result
for null.

Signed-off-by: Edward Wang <edward.c.wang at compdigitec.com>

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

 vlc-android/src/org/videolan/vlc/VLCApplication.java |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index e915a46..3d64be2 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -71,8 +71,8 @@ public class VLCApplication extends Application {
             Locale.setDefault(locale);
             Configuration config = new Configuration();
             config.locale = locale;
-            getBaseContext().getResources().updateConfiguration(config,
-                    getBaseContext().getResources().getDisplayMetrics());
+            getResources().updateConfiguration(config,
+                    getResources().getDisplayMetrics());
         }
 
         instance = this;
@@ -107,7 +107,6 @@ public class VLCApplication extends Application {
      */
     public static Resources getAppResources()
     {
-        if(instance == null) return null;
         return instance.getResources();
     }
 }



More information about the Android mailing list