diff options
author | Parménides GV <parmegv@sdf.org> | 2014-04-21 20:32:09 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-04-21 20:32:09 +0200 |
commit | b7d3a5a1582306e380ee07cb3c2a3066e16bcf1b (patch) | |
tree | e541e07e26b7d82a551a7a9ddf2aba922c255e81 /app/src/main | |
parent | 38ebb49be8f195c41a30d0da4d91fc2e61846e63 (diff) |
Nullpointers fixed.
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java | 6 | ||||
-rw-r--r-- | app/src/main/java/se/leap/openvpn/OpenVpnService.java | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java index 15cc5b4d..4341c9dc 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java @@ -120,13 +120,17 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe protected void saveEipStatus() { boolean eip_is_on = false; + Log.d("bitmask", "saveEipStatus"); if(eipSwitch.isChecked()) { eip_is_on = true; } - getActivity().getSharedPreferences(Dashboard.SHARED_PREFERENCES, Activity.MODE_PRIVATE).edit().putBoolean(Dashboard.START_ON_BOOT, eip_is_on).commit(); + + if(getActivity() != null) + getActivity().getSharedPreferences(Dashboard.SHARED_PREFERENCES, Activity.MODE_PRIVATE).edit().putBoolean(Dashboard.START_ON_BOOT, eip_is_on).commit(); } @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + Log.d("bitmask", "onCheckChanged"); if (buttonView.equals(eipSwitch) && !eipAutoSwitched){ boolean allowed_anon = getActivity().getSharedPreferences(Dashboard.SHARED_PREFERENCES, Activity.MODE_PRIVATE).getBoolean(EIP.ALLOWED_ANON, false); String certificate = getActivity().getSharedPreferences(Dashboard.SHARED_PREFERENCES, Activity.MODE_PRIVATE).getString(EIP.CERTIFICATE, ""); diff --git a/app/src/main/java/se/leap/openvpn/OpenVpnService.java b/app/src/main/java/se/leap/openvpn/OpenVpnService.java index 11071802..475ed75b 100644 --- a/app/src/main/java/se/leap/openvpn/OpenVpnService.java +++ b/app/src/main/java/se/leap/openvpn/OpenVpnService.java @@ -163,7 +163,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac PendingIntent getLogPendingIntent() { // Let the configure Button show the Dashboard - Intent intent = new Intent(Dashboard.getAppContext(),Dashboard.class); + Intent intent = new Intent(getApplicationContext(),Dashboard.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent startLW = PendingIntent.getActivity(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); |