From a85b2177566d2ba3c541e27a8a15a005883ec952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 10 Apr 2014 13:58:19 +0200 Subject: Minimize use of class variables in ViewKey --- .../org/sufficientlysecure/keychain/ui/ViewKeyActivity.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java index 09c6b6e0a..3789ff55d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -140,7 +140,7 @@ public class ViewKeyActivity extends ActionBarActivity { uploadToKeyserver(mDataUri); return true; case R.id.menu_key_view_export_file: - exportToFile(mDataUri); + exportToFile(mDataUri, mExportHelper); return true; case R.id.menu_key_view_share_default_fingerprint: shareKey(mDataUri, true); @@ -161,14 +161,14 @@ public class ViewKeyActivity extends ActionBarActivity { copyToClipboard(mDataUri); return true; case R.id.menu_key_view_delete: { - deleteKey(mDataUri); + deleteKey(mDataUri, mExportHelper); return true; } } return super.onOptionsItemSelected(item); } - private void exportToFile(Uri dataUri) { + private void exportToFile(Uri dataUri, ExportHelper exportHelper) { Uri baseUri = KeychainContract.KeyRings.buildUnifiedKeyRingUri(dataUri); HashMap data = ProviderHelper.getGenericData(this, @@ -176,7 +176,7 @@ public class ViewKeyActivity extends ActionBarActivity { new String[]{KeychainContract.Keys.MASTER_KEY_ID, KeychainContract.KeyRings.HAS_SECRET}, new int[]{ProviderHelper.FIELD_TYPE_INTEGER, ProviderHelper.FIELD_TYPE_INTEGER}); - mExportHelper.showExportKeysDialog( + exportHelper.showExportKeysDialog( new long[]{(Long) data.get(KeychainContract.KeyRings.MASTER_KEY_ID)}, Constants.Path.APP_DIR_FILE, ((Long) data.get(KeychainContract.KeyRings.HAS_SECRET) == 1) @@ -277,7 +277,7 @@ public class ViewKeyActivity extends ActionBarActivity { dialog.show(getSupportFragmentManager(), "shareNfcDialog"); } - private void deleteKey(Uri dataUri) { + private void deleteKey(Uri dataUri, ExportHelper exportHelper) { // Message is received after key is deleted Handler returnHandler = new Handler() { @Override @@ -287,7 +287,7 @@ public class ViewKeyActivity extends ActionBarActivity { } }; - mExportHelper.deleteKey(dataUri, returnHandler); + exportHelper.deleteKey(dataUri, returnHandler); } @Override -- cgit v1.2.3