diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-04-10 13:53:02 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-04-10 13:53:02 +0200 |
commit | da4016d565b124fbf1d0444cb2e3e2a1e8d34ea3 (patch) | |
tree | 92ec6c5131f50bc06dfc10179d49382c0e14afaa /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | b3a39d7c249ded38ecbeed2d5bdce734bf9bacf4 (diff) | |
download | open-keychain-da4016d565b124fbf1d0444cb2e3e2a1e8d34ea3.tar.gz open-keychain-da4016d565b124fbf1d0444cb2e3e2a1e8d34ea3.tar.bz2 open-keychain-da4016d565b124fbf1d0444cb2e3e2a1e8d34ea3.zip |
Cleanup AsyncTask code for NFC
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java | 14 |
1 files changed, 8 insertions, 6 deletions
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 2a169989b..09c6b6e0a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -230,7 +230,7 @@ public class ViewKeyActivity extends ActionBarActivity { // see http://www.lonestarprod.com/?p=34 if (content.length() >= 86389) { AppMsg.makeText(this, R.string.key_too_big_for_sharing, - AppMsg.STYLE_ALERT).show(); + AppMsg.STYLE_ALERT).show(); return; } } catch (ProviderHelper.NotFoundException e) { @@ -266,7 +266,7 @@ public class ViewKeyActivity extends ActionBarActivity { ClipboardReflection.copyToClipboard(this, keyringArmored.get(0)); AppMsg.makeText(this, R.string.key_copied_to_clipboard, AppMsg.STYLE_INFO) - .show(); + .show(); } catch (ProviderHelper.NotFoundException e) { Log.e(Constants.TAG, "key not found!", e); } @@ -351,9 +351,9 @@ public class ViewKeyActivity extends ActionBarActivity { * mNfcKeyringBytes can not be retrieved in createNdefMessage, because this process * has no permissions to query the Uri. */ - AsyncTask<NfcAdapter, Void, Void> initTask = - new AsyncTask<NfcAdapter, Void, Void>() { - protected Void doInBackground(NfcAdapter... adapter) { + AsyncTask<Void, Void, Void> initTask = + new AsyncTask<Void, Void, Void>() { + protected Void doInBackground(Void... unused) { try { Uri blobUri = KeychainContract.KeyRingData.buildPublicKeyRingUri(dataUri); @@ -364,10 +364,12 @@ public class ViewKeyActivity extends ActionBarActivity { } catch (ProviderHelper.NotFoundException e) { Log.e(Constants.TAG, "key not found!", e); } + + // no AsyncTask return (Void) return null; } - protected void onPostExecute(Void result) { + protected void onPostExecute(Void unused) { // Register callback to set NDEF message mNfcAdapter.setNdefPushMessageCallback(mNdefCallback , ViewKeyActivity.this); |