From b3ebb646663f166c6dd2c7d2cfbc47293582b33e Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Tue, 2 Jun 2015 22:19:41 +0200 Subject: [PATCH] hide invoke nfc button in android < 5 --- .../keychain/ui/ViewKeyAdvShareFragment.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyAdvShareFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyAdvShareFragment.java index 479ddae0b..42abf35eb 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyAdvShareFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyAdvShareFragment.java @@ -140,12 +140,17 @@ public class ViewKeyAdvShareFragment extends LoaderFragment implements } }); - mKeyNfcButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - mNfcHelper.invokeNfcBeam(); - } - }); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + mKeyNfcButton.setVisibility(View.VISIBLE); + mKeyNfcButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + mNfcHelper.invokeNfcBeam(); + } + }); + } else { + mKeyNfcButton.setVisibility(View.GONE); + } mKeySafeSlingerButton.setOnClickListener(new View.OnClickListener() { @Override