summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorZeapo <mohamed@zenadi.com>2014-08-09 01:25:56 +0100
committerZeapo <mohamed@zenadi.com>2014-08-09 01:25:56 +0100
commit265ac86903f6a35fccbc96ec781bad26b0c5c268 (patch)
tree5adb5aa772b2ed5be58a2c138284a126dfc83e4c /app/src/main/java
parentfca8ab5bd6866d20ba0e27772b33e986791da89f (diff)
refresh list after pull and removal
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/GitAsyncTask.java1
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordStore.java7
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java2
3 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/GitAsyncTask.java b/app/src/main/java/com/zeapo/pwdstore/GitAsyncTask.java
index 085798ce..8db11c43 100644
--- a/app/src/main/java/com/zeapo/pwdstore/GitAsyncTask.java
+++ b/app/src/main/java/com/zeapo/pwdstore/GitAsyncTask.java
@@ -59,6 +59,7 @@ public class GitAsyncTask extends AsyncTask<GitCommand, Integer, Integer> {
Log.i("GIT_ASYNC", result + "");
this.dialog.dismiss();
if (finishOnEnd) {
+ this.activity.setResult(Activity.RESULT_OK);
this.activity.finish();
}
}
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
index 0ff75c3b..e291b8df 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
@@ -102,14 +102,14 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
case R.id.git_push:
intent = new Intent(this, GitHandler.class);
intent.putExtra("Operation", GitHandler.REQUEST_PUSH);
- startActivity(intent);
+ startActivityForResult(intent, GitHandler.REQUEST_PUSH);
this.leftActivity = true;
return true;
case R.id.git_pull:
intent = new Intent(this, GitHandler.class);
intent.putExtra("Operation", GitHandler.REQUEST_PULL);
- startActivity(intent);
+ startActivityForResult(intent, GitHandler.REQUEST_PULL);
this.leftActivity = true;
return true;
@@ -253,6 +253,9 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
+ if (resultCode == RESULT_CANCELED)
+ refreshListAdapter();
+
if (resultCode == RESULT_OK) {
refreshListAdapter();
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
index 58a150d8..754381cf 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
@@ -452,7 +452,7 @@ public class PgpHandler extends Activity {
git.rm().addFilepattern(getIntent().getExtras().getString("FILE_PATH").replace(PasswordRepository.getWorkTree() + "/", "")),
git.commit().setMessage("[ANDROID PwdStore] Remove " + getIntent().getExtras().getString("FILE_PATH") + " from store.")
);
- setResult(RESULT_OK);
+ setResult(RESULT_CANCELED);
finish();
}
})