diff options
Diffstat (limited to 'app/src/main/java/com')
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(); } }) |