aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-01-09 23:13:23 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-01-09 23:13:23 +0100
commit37fd7dbbc70d6fc033db4101eaf89bad627fe499 (patch)
treed3250a834123281176342c1f3910366b7b2ede85 /OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java
parentbb161d5fa9d56c5fc7369c979d6fd4eeff187987 (diff)
downloadopen-keychain-37fd7dbbc70d6fc033db4101eaf89bad627fe499.tar.gz
open-keychain-37fd7dbbc70d6fc033db4101eaf89bad627fe499.tar.bz2
open-keychain-37fd7dbbc70d6fc033db4101eaf89bad627fe499.zip
fix bad crashes
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java')
-rw-r--r--OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java
index 569a16c41..b79200ba1 100644
--- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java
+++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java
@@ -27,6 +27,7 @@ import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.Id;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
+import org.sufficientlysecure.keychain.helper.ExportHelper;
import org.sufficientlysecure.keychain.pgp.PgpConversionHelper;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
@@ -61,11 +62,12 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.LinearLayout;
import android.widget.Toast;
+import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.beardedhen.androidbootstrap.BootstrapButton;
-public class EditKeyActivity extends KeyActivity {
+public class EditKeyActivity extends SherlockFragmentActivity {
// Actions for internal use only:
public static final String ACTION_CREATE_KEY = Constants.INTENT_PREFIX + "CREATE_KEY";
@@ -100,10 +102,14 @@ public class EditKeyActivity extends KeyActivity {
Vector<Integer> mKeysUsages;
boolean masterCanSign = true;
+ ExportHelper mExportHelper;
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ mExportHelper = new ExportHelper(this);
+
mUserIds = new Vector<String>();
mKeys = new Vector<PGPSecretKey>();
mKeysUsages = new Vector<Integer>();
@@ -322,7 +328,7 @@ public class EditKeyActivity extends KeyActivity {
cancelClicked();
return true;
case R.id.menu_key_edit_export_file:
- showExportKeysDialog(mDataUri, Id.type.secret_key, Constants.path.APP_DIR
+ mExportHelper.showExportKeysDialog(mDataUri, Id.type.secret_key, Constants.path.APP_DIR
+ "/secexport.asc");
return true;
case R.id.menu_key_edit_delete: {
@@ -337,7 +343,7 @@ public class EditKeyActivity extends KeyActivity {
}
};
- deleteKey(mDataUri, Id.type.secret_key, returnHandler);
+ mExportHelper.deleteKey(mDataUri, Id.type.secret_key, returnHandler);
return true;
}
}
@@ -656,4 +662,11 @@ public class EditKeyActivity extends KeyActivity {
mChangePassPhrase.setText(isPassphraseSet() ? getString(R.string.btn_change_passphrase)
: getString(R.string.btn_set_passphrase));
}
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (!mExportHelper.handleActivityResult(requestCode, resultCode, data)) {
+ super.onActivityResult(requestCode, resultCode, data);
+ }
+ }
}