aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorzeapo <mohamed@zenadi.com>2014-08-23 19:35:59 +0200
committerzeapo <mohamed@zenadi.com>2014-08-23 19:35:59 +0200
commit9784af6d66fc88651f260f084e28ddee42ea8cab (patch)
tree496cc44c06344641436725ed6c2f37a0f802043b /app/src/main/java
parentc7d541c1976b6e77627a7fe73a4707fd7900eadd (diff)
avoid eternal looping when selecting an openpgp provider
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java26
1 files changed, 15 insertions, 11 deletions
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 cbbc0c11..47d21834 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
@@ -89,21 +89,25 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
Toast.makeText(this, "No OpenPGP Provider selected!", Toast.LENGTH_LONG).show();
Intent intent = new Intent(this, UserPreference.class);
startActivity(intent);
+ // a small hack to avoid eternal loop later, have to be solved via a startactivityforresult()
+ setResult(RESULT_CANCELED);
+ finish();
- }
+ } else {
- // bind to service
- mServiceConnection = new OpenPgpServiceConnection(
- PgpHandler.this, providerPackageName, this );
- mServiceConnection.bindToService();
+ // bind to service
+ mServiceConnection = new OpenPgpServiceConnection(
+ PgpHandler.this, providerPackageName, this);
+ mServiceConnection.bindToService();
- bindingDialog = new ProgressDialog(this);
- bindingDialog.setMessage("Waiting for OpenKeychain...");
- bindingDialog.setCancelable(false);
- bindingDialog.show();
+ bindingDialog = new ProgressDialog(this);
+ bindingDialog.setMessage("Waiting for OpenKeychain...");
+ bindingDialog.setCancelable(false);
+ bindingDialog.show();
- ActionBar actionBar = getActionBar();
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBar actionBar = getActionBar();
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ }
}
@Override