summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
diff options
context:
space:
mode:
authorFup Duck <fupduck@sacknagel.com>2018-01-13 16:53:54 +0100
committerFup Duck <fupduck@sacknagel.com>2018-01-13 16:53:54 +0100
commit1690dec51d78a27a6a1f7c83d30b28d1ab432f93 (patch)
tree40d6011b575615a671edbd3881949b2bbf480e64 /app/src/main/java/se/leap/bitmaskclient/StartActivity.java
parent5d5d6ae8aeafbba407b9a4cf5985a1cdc1cf2904 (diff)
static constant imports
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/StartActivity.java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/StartActivity.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
index 614c6b8d..43d7f152 100644
--- a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
@@ -15,6 +15,9 @@ import java.lang.annotation.RetentionPolicy;
import de.blinkt.openvpn.core.VpnStatus;
import se.leap.bitmaskclient.userstatus.User;
+import static se.leap.bitmaskclient.Constants.PREFERENCES_APP_VERSION;
+import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES;
+
/**
* Activity shown at startup. Evaluates if App is started for the first time or has been upgraded
* and acts and calls another activity accordingly.
@@ -39,7 +42,7 @@ public class StartActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- preferences = getSharedPreferences(Constants.SHARED_PREFERENCES, MODE_PRIVATE);
+ preferences = getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE);
Log.d(TAG, "Started");
@@ -81,7 +84,7 @@ public class StartActivity extends Activity {
private int checkAppStart() {
try {
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
- previousVersionCode = preferences.getInt(Constants.PREFERENCES_APP_VERSION, -1);
+ previousVersionCode = preferences.getInt(PREFERENCES_APP_VERSION, -1);
// versions do match -> normal start
if (versionCode == previousVersionCode) {
@@ -135,7 +138,7 @@ public class StartActivity extends Activity {
}
private void storeAppVersion() {
- preferences.edit().putInt(Constants.PREFERENCES_APP_VERSION, versionCode).apply();
+ preferences.edit().putInt(PREFERENCES_APP_VERSION, versionCode).apply();
}
}