summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorPeter Rustler <peter.rustler@basyskom.com>2015-03-02 15:58:40 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-03-18 08:46:35 +0000
commit55aab6b68bf4991fb133b5f7066a07554e3c5b3e (patch)
tree0fa4192391379d04a19f9dce1da46c70e57fe2a8 /src/android
parentcace1dd0a88245129ebef2e98f13749f2f31fa4f (diff)
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 <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/nfc/src/org/qtproject/qt5/android/nfc/QtNfc.java14
1 files changed, 14 insertions, 0 deletions
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;
+ }
+ }
}