From 8742e9a8b8b3377ce615aeedc34543a5716af4cc Mon Sep 17 00:00:00 2001 From: michaelr Date: Sun, 28 Feb 2016 13:00:51 +0200 Subject: [PATCH] fixed for java to compile Former-commit-id: 3d37ea77cd676e152ac0a831a576563fbbc77f87 --- .../main/java/com/messenger/MainActivity.java | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/android/app/src/main/java/com/messenger/MainActivity.java b/android/app/src/main/java/com/messenger/MainActivity.java index 6f7ed2e001..0ae4750a8f 100644 --- a/android/app/src/main/java/com/messenger/MainActivity.java +++ b/android/app/src/main/java/com/messenger/MainActivity.java @@ -31,13 +31,12 @@ public class MainActivity extends ReactActivity { properties.setProperty("http.nonProxyHosts", "localhost|127.0.0.1"); properties.setProperty("https.nonProxyHosts", "localhost|127.0.0.1"); - String dataFolder = null; File extStore = Environment.getExternalStorageDirectory(); - if (extStore.exists()) { - dataFolder = extStore.getAbsolutePath(); - } else { - dataFolder = getApplicationInfo().dataDir; - } + + final String dataFolder = extStore.exists() ? + extStore.getAbsolutePath() : + getApplicationInfo().dataDir; + // Launch! new Thread(new Runnable() { public void run() { @@ -64,16 +63,16 @@ public class MainActivity extends ReactActivity { return BuildConfig.DEBUG; } - /** - * A list of packages used by the app. If the app uses additional views - * or modules besides the default ones, add more packages here. - */ + /** + * A list of packages used by the app. If the app uses additional views + * or modules besides the default ones, add more packages here. + */ @Override protected List getPackages() { - return Arrays.asList( - new MainReactPackage(), - new ReactNativeContacts(), - new ReactNativeI18n() - ); + return Arrays.asList( + new MainReactPackage(), + new ReactNativeContacts(), + new ReactNativeI18n() + ); } }