[Android] [PATCH] Small VLCApplication refactoring.

Andrey Khalyavin halyavin at google.com
Thu Dec 4 19:48:39 CET 2014


>From bc550c0669899bb442fb868fa8c90aa5d7eaf8ec Mon Sep 17 00:00:00 2001
From: Andrey Khalyavin <halyavin at google.com>
Date: Thu, 4 Dec 2014 13:03:25 +0300
Subject: [PATCH] Small VLCApplication refactoring.

Application.getResources() is equivalent to getBaseContext().getResources().
Neither of 5 references to VLCApplication.getAppResources() check its result
for null.
---
 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();
     }
 }
-- 
2.2.0.rc0.207.ga3a616c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/android/attachments/20141204/565173b2/attachment.html>


More information about the Android mailing list