summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed Zenadi <mohamed@zenadi.com>2015-04-20 22:26:32 +0200
committerMohamed Zenadi <mohamed@zenadi.com>2015-05-17 18:49:15 +0200
commit6cafdcfdc03eb526b9c7016f79971a34145c8022 (patch)
tree7f3d27193075d674ffcc0ebe2a55b0f058b44d61
parent47ffaf99bd98cb4f362f4446c2bd910e222989bf (diff)
save the selected directory and show it as a summary
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/UserPreference.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.java b/app/src/main/java/com/zeapo/pwdstore/UserPreference.java
index e8bacad5..e22ef382 100644
--- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.java
+++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.java
@@ -46,8 +46,6 @@ public class UserPreference extends AppCompatActivity {
final UserPreference callingActivity = (UserPreference) getActivity();
final SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences();
- addPreferencesFromResource(R.xml.preference);
-
Preference keyPref = findPreference("openpgp_key_id_pref");
String selectedKeys = sharedPreferences.getString("openpgp_key_ids", "");
if (Strings.isNullOrEmpty(selectedKeys)) {
@@ -221,5 +219,13 @@ public class UserPreference extends AppCompatActivity {
break;
}
}
+
+ // why do they have to use a different resultCode than OK :/
+ if (requestCode == SELECT_GIT_DIRECTORY && resultCode == DirectoryChooserActivity.RESULT_CODE_DIR_SELECTED) {
+ PreferenceManager.getDefaultSharedPreferences(getApplicationContext())
+ .edit()
+ .putString("git_external_repo", data.getStringExtra(DirectoryChooserActivity.RESULT_SELECTED_DIR))
+ .commit();
+ }
}
}