From 55aab6b68bf4991fb133b5f7066a07554e3c5b3e Mon Sep 17 00:00:00 2001 From: Peter Rustler Date: Mon, 2 Mar 2015 15:58:40 +0100 Subject: Add the feature to get the nfc intent that startet the app To support this one have to add a AndroidManifest.xml file to the project. In that file an intent filter should be added to get nfc intents while in backround.. The corkboard example was extended to have an example for this new feature. Change-Id: I108afd88f9e5a548d62245591ebef11de8eb0d81 Reviewed-by: Alex Blasche --- .../nfc/src/org/qtproject/qt5/android/nfc/QtNfc.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/android') diff --git a/src/android/nfc/src/org/qtproject/qt5/android/nfc/QtNfc.java b/src/android/nfc/src/org/qtproject/qt5/android/nfc/QtNfc.java index ec1b6fa9..566489c8 100644 --- a/src/android/nfc/src/org/qtproject/qt5/android/nfc/QtNfc.java +++ b/src/android/nfc/src/org/qtproject/qt5/android/nfc/QtNfc.java @@ -149,4 +149,18 @@ public class QtNfc } return m_adapter.isEnabled(); } + + static public Intent getStartIntent() + { + Log.d(TAG, "getStartIntent"); + if (m_activity == null) return null; + Intent intent = m_activity.getIntent(); + if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()) || + NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction()) || + NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) { + return intent; + } else { + return null; + } + } } -- cgit v1.2.3