summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorPeter Rustler <peter.rustler@basyskom.com>2015-01-09 16:14:17 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-01-21 12:13:25 +0100
commitf93c04e44a5bd08fea76a1147b1aa51953bce925 (patch)
tree210e9f2e0162da6471ccec98c0529943e98984f8 /src/plugins
parentc87566bf9eb8e699aa1400876c1e314ff62f59fe (diff)
Added new private API for Android and onNewIntent
On Android the foreground activity can get intents with onNewIntent. Those intents can not be received in any other way. This is especially true in Android nfc. This patch adds a way to receive those intents in Qt. This patch heavily leans on the implementation of onActivityResult. Change-Id: Ic4dca301f34afe9a528149c3653e545ed3265a3c Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index ab653860f3..18d3ebb456 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -648,6 +648,11 @@ static void onActivityResult(JNIEnv */*env*/, jclass /*cls*/,
QtAndroidPrivate::handleActivityResult(requestCode, resultCode, data);
}
+static void onNewIntent(JNIEnv *env, jclass /*cls*/, jobject data)
+{
+ QtAndroidPrivate::handleNewIntent(env, data);
+}
+
static JNINativeMethod methods[] = {
{"startQtAndroidPlugin", "()Z", (void *)startQtAndroidPlugin},
{"startQtApplication", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)startQtApplication},
@@ -658,7 +663,8 @@ static JNINativeMethod methods[] = {
{"updateWindow", "()V", (void *)updateWindow},
{"updateApplicationState", "(I)V", (void *)updateApplicationState},
{"handleOrientationChanged", "(II)V", (void *)handleOrientationChanged},
- {"onActivityResult", "(IILandroid/content/Intent;)V", (void *)onActivityResult}
+ {"onActivityResult", "(IILandroid/content/Intent;)V", (void *)onActivityResult},
+ {"onNewIntent", "(Landroid/content/Intent;)V", (void *)onNewIntent}
};
#define FIND_AND_CHECK_CLASS(CLASS_NAME) \