summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/Dashboard.java
diff options
context:
space:
mode:
authorSean Leonard <meanderingcode@aetherislands.net>2013-06-08 20:55:48 -0600
committerSean Leonard <meanderingcode@aetherislands.net>2013-06-08 21:24:49 -0600
commit899583d474a0b04e168203ce06195403461b9215 (patch)
treeb9af34493c35d39b3719adec2ed417ee5dcb4cfb /src/se/leap/leapclient/Dashboard.java
parentd74a3ae14a27893572d170c138e18522b541866a (diff)
Improve retrieving and saving SharedPreferences for different types (String, boolean, JSONObject)
Diffstat (limited to 'src/se/leap/leapclient/Dashboard.java')
-rw-r--r--src/se/leap/leapclient/Dashboard.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java
index 5ffbc19e..de7946e9 100644
--- a/src/se/leap/leapclient/Dashboard.java
+++ b/src/se/leap/leapclient/Dashboard.java
@@ -16,6 +16,7 @@ import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentTransaction;
+import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
@@ -34,6 +35,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
protected static final int CONFIGURE_LEAP = 0;
+ private static Context app;
private static SharedPreferences preferences;
private static Provider provider;
@@ -45,6 +47,9 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+
+ app = this;
+
setContentView(R.layout.client_dashboard);
preferences = getSharedPreferences(ConfigHelper.PREFERENCES_KEY,MODE_PRIVATE);
@@ -288,4 +293,8 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
}
}
+ // Used for getting Context when outside of a class extending Context
+ public static Context getAppContext() {
+ return app;
+ }
}