refresh list after pull and removal

This commit is contained in:
Zeapo 2014-08-09 01:25:56 +01:00
parent fca8ab5bd6
commit 265ac86903
3 changed files with 7 additions and 3 deletions

View file

@ -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();
}
}

View file

@ -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();

View file

@ -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();
}
})