corrected a bug where binding dialog was not dismissed

This commit is contained in:
zeapo 2014-08-17 13:38:21 +02:00
parent 6958ba5eed
commit c2fb1a3ee2

View file

@ -263,7 +263,6 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
@Override @Override
public void onReturn(Intent result) { public void onReturn(Intent result) {
bindingDialog.dismiss();
switch (result.getIntExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR)) { switch (result.getIntExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR)) {
case OpenPgpApi.RESULT_CODE_SUCCESS: { case OpenPgpApi.RESULT_CODE_SUCCESS: {
@ -275,6 +274,8 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
Log.d(OpenPgpApi.TAG, "result: " + os.toByteArray().length Log.d(OpenPgpApi.TAG, "result: " + os.toByteArray().length
+ " str=" + os.toString("UTF-8")); + " str=" + os.toString("UTF-8"));
bindingDialog.dismiss();
if (returnToCiphertextField) { if (returnToCiphertextField) {
findViewById(R.id.crypto_container).setVisibility(View.VISIBLE); findViewById(R.id.crypto_container).setVisibility(View.VISIBLE);
@ -463,12 +464,16 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
((TextView) findViewById(R.id.crypto_password_category)).setText(cat + "/"); ((TextView) findViewById(R.id.crypto_password_category)).setText(cat + "/");
decryptAndVerify(new Intent()); decryptAndVerify(new Intent());
} else if (extra.getString("Operation").equals("ENCRYPT")) { } else if (extra.getString("Operation").equals("ENCRYPT")) {
bindingDialog.dismiss();
setContentView(R.layout.encrypt_layout); setContentView(R.layout.encrypt_layout);
String cat = extra.getString("FILE_PATH"); String cat = extra.getString("FILE_PATH");
cat = cat.replace(PasswordRepository.getWorkTree().getAbsolutePath(), ""); cat = cat.replace(PasswordRepository.getWorkTree().getAbsolutePath(), "");
cat = cat + "/"; cat = cat + "/";
((TextView) findViewById(R.id.crypto_password_category)).setText(cat); ((TextView) findViewById(R.id.crypto_password_category)).setText(cat);
} else if (extra.getString("Operation").equals("GET_KEY_ID")) { } else if (extra.getString("Operation").equals("GET_KEY_ID")) {
bindingDialog.dismiss();
setContentView(R.layout.key_id); setContentView(R.layout.key_id);
if (!keyIDs.isEmpty()) { if (!keyIDs.isEmpty()) {
String keys = keyIDs.split(",").length > 1 ? keyIDs : keyIDs.split(",")[0]; String keys = keyIDs.split(",").length > 1 ? keyIDs : keyIDs.split(",")[0];