title: Qt for Android - startActivityForResult equivalent does not work
body: <p>There are poorly documented features in Qt for Android - we can use Intent features by JNI (Java Native Interface). There are some examples with startActivity equivalent, but I did not find any with result receiving.</p>
  
  <p>Here's Java code with ilustration what I want to do:</p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
  intent.setType("file/*");
  getActivity().startActivityForResult(intent, 1);
  </code></pre>
  
  <p>I used documentation to write equivalent in Qt:</p>
  
  <pre><code>QAndroidJniObject ACTION_GET_CONTENT = QAndroidJniObject::getStaticObjectField&lt;jstring&gt;("android/content/Intent", "ACTION_GET_CONTENT");
  QAndroidJniObject intent("android/content/Intent");
  if (ACTION_GET_CONTENT.isValid() &amp;&amp; intent.isValid()) {
      intent.callObjectMethod("setAction", "(Ljava/lang/string;)V", ACTION_GET_CONTENT.object&lt;jstring&gt;());
      intent.callObjectMethod("setType", "(Ljava/lang/string;)V", QAndroidJniObject::fromString("file/*").object&lt;jstring&gt;());
      QtAndroid::startActivity(intent, EXISTING_FILE_NAME_REQUEST, receiver);
      return true;
  } else {
      return false;
  }
  </code></pre>
  
  <p>receiver is a pointer to object of class, which extends abstract class QAndroidActivityResultReceiver. Here's it's implementation of virtual function handleActivityResult:</p>
  
  <pre><code>void MyReceiver::handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &amp;data)
  {
      jint RESULT_OK = QAndroidJniObject::getStaticField&lt;jint&gt;("android/app/Activity", "RESULT_OK");
      if (receiverRequestCode == EXISTING_FILE_NAME_REQUEST &amp;&amp; resultCode == RESULT_OK) {
          QString path = data.callObjectMethod("getData", "()Landroid/net/Uri;").callObjectMethod("getPath", "()Ljava/lang/String;").toString();
          _dialog-&gt;emitExistingFileNameReady(path);
      } else {
          _dialog-&gt;emitExistingFileNameReady(QString());
      }
  }
  </code></pre>
  
  <p>Something is wrong with my code, because when I run it, following error messages appears (and program is being aborted):</p>
  
  <pre><code>F/art     ( 6837): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception 'android.content.ActivityNotFoundException' thrown in unknown throw location
  F/art     ( 6837): art/runtime/check_jni.cc:65]     in call to NewGlobalRef
  F/art     ( 6837): art/runtime/check_jni.cc:65] "QtThread" prio=5 tid=15 Runnable
  F/art     ( 6837): art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x12e75100 self=0xaec43400
  F/art     ( 6837): art/runtime/check_jni.cc:65]   | sysTid=6882 nice=0 cgrp=default sched=0/0 handle=0xb491b780
  F/art     ( 6837): art/runtime/check_jni.cc:65]   | state=R schedstat=( 0 0 0 ) utm=39 stm=20 core=0 HZ=100
  F/art     ( 6837): art/runtime/check_jni.cc:65]   | stack=0xa2b04000-0xa2b06000 stackSize=1012KB
  F/art     ( 6837): art/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #00 pc 00004e64  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #01 pc 00003665  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #02 pc 00256429  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, int, char const*, art::mirror::ArtMethod*)+84)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #03 pc 00238fe7  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;) const+158)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #04 pc 000b191b  /system/lib/libart.so (art::JniAbort(char const*, char const*)+610)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #05 pc 000b2055  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #06 pc 000b530f  /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1346)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #07 pc 000b66cd  /system/lib/libart.so (art::CheckJNI::NewGlobalRef(_JNIEnv*, _jobject*)+28)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #08 pc 001ea0a7  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QJNIObjectPrivate::QJNIObjectPrivate(_jobject*)+82)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #09 pc 001ea69d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (???)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #10 pc 001ec719  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QJNIObjectPrivate::getStaticObjectField(char const*, char const*, char const*)+48)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #11 pc 0017718d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (???)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #12 pc 00177a3d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QStandardPaths::writableLocation(QStandardPaths::StandardLocation)+860)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #13 pc 0017841f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QStandardPaths::standardLocations(QStandardPaths::StandardLocation)+790)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #14 pc 00013e5b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libTouchImage.so (ApplicationController::openFileButtonClicked()+130)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #15 pc 001cce4f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QMetaObject::activate(QObject*, int, int, void**)+394)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #16 pc 00261987  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QAbstractButton::clicked(bool)+26)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #17 pc 001460f9  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #18 pc 001468f7  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #19 pc 00146979  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QAbstractButton::mouseReleaseEvent(QMouseEvent*)+88)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #20 pc 0019d509  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QToolButton::mouseReleaseEvent(QMouseEvent*)+4)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #21 pc 00100bbd  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QWidget::event(QEvent*)+536)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #22 pc 0019d57d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QToolButton::event(QEvent*)+50)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #23 pc 000e2a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::notify_helper(QObject*, QEvent*)+104)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #24 pc 000e5583  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplication::notify(QObject*, QEvent*)+1382)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #25 pc 001ae40f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::notifyInternal(QObject*, QEvent*)+62)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #26 pc 000e4d5b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&lt;QWidget&gt;&amp;, bool)+286)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #27 pc 0010a19b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #28 pc 0010a8d3  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #29 pc 000e2a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::notify_helper(QObject*, QEvent*)+104)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #30 pc 000e5e53  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplication::notify(QObject*, QEvent*)+3638)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #31 pc 001ae40f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::notifyInternal(QObject*, QEvent*)+62)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #32 pc 000a09cd  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)+516)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #33 pc 000a06ed  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent*)+3492)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #34 pc 000a1b13  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)+382)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #35 pc 00093181  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QWindowSystemInterface::sendWindowSystemEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)+20)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #36 pc 00028135  /data/data/org.qtproject.example.TouchImage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #37 pc 001ad533  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QEventLoop::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)+14)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #38 pc 001adc13  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)+226)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #39 pc 001b2527  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::exec()+82)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #40 pc 00012a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libTouchImage.so (main+48)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #41 pc 000190b5  /data/data/org.qtproject.example.TouchImage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #42 pc 00016baf  /system/lib/libc.so (__pthread_start(void*)+30)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #43 pc 00014af3  /system/lib/libc.so (__start_thread+6)
  F/art     ( 6837): art/runtime/check_jni.cc:65]   (no managed stack frames)
  F/art     ( 6837): art/runtime/check_jni.cc:65] 
  F/art     ( 6837): art/runtime/runtime.cc:289] Runtime aborting...
  F/art     ( 6837): art/runtime/runtime.cc:289] Aborting thread:
  F/art     ( 6837): art/runtime/runtime.cc:289] "QtThread" prio=5 tid=15 Native
  F/art     ( 6837): art/runtime/runtime.cc:289]   | group="" sCount=0 dsCount=0 obj=0x12e75100 self=0xaec43400
  F/art     ( 6837): art/runtime/runtime.cc:289]   | sysTid=6882 nice=0 cgrp=default sched=0/0 handle=0xb491b780
  F/art     ( 6837): art/runtime/runtime.cc:289]   | state=R schedstat=( 0 0 0 ) utm=42 stm=20 core=0 HZ=100
  F/art     ( 6837): art/runtime/runtime.cc:289]   | stack=0xa2b04000-0xa2b06000 stackSize=1012KB
  F/art     ( 6837): art/runtime/runtime.cc:289]   | held mutexes= "abort lock" "mutator lock"(shared held)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #00 pc 00004e64  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #01 pc 00003665  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #02 pc 00256429  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, int, char const*, art::mirror::ArtMethod*)+84)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #03 pc 00238fe7  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;) const+158)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #04 pc 0022881d  /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, art::Thread*)+32)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #05 pc 00228abf  /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;)+410)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #06 pc 00228c7f  /system/lib/libart.so (art::Runtime::Abort()+82)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #07 pc 000a7371  /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #08 pc 000b1b17  /system/lib/libart.so (art::JniAbort(char const*, char const*)+1118)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #09 pc 000b2055  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #10 pc 000b530f  /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1346)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #11 pc 000b66cd  /system/lib/libart.so (art::CheckJNI::NewGlobalRef(_JNIEnv*, _jobject*)+28)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #12 pc 001ea0a7  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QJNIObjectPrivate::QJNIObjectPrivate(_jobject*)+82)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #13 pc 001ea69d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (???)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #14 pc 001ec719  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QJNIObjectPrivate::getStaticObjectField(char const*, char const*, char const*)+48)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #15 pc 0017718d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (???)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #16 pc 00177a3d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QStandardPaths::writableLocation(QStandardPaths::StandardLocation)+860)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #17 pc 0017841f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QStandardPaths::standardLocations(QStandardPaths::StandardLocation)+790)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #18 pc 00013e5b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libTouchImage.so (ApplicationController::openFileButtonClicked()+130)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #19 pc 001cce4f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QMetaObject::activate(QObject*, int, int, void**)+394)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #20 pc 00261987  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QAbstractButton::clicked(bool)+26)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #21 pc 001460f9  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #22 pc 001468f7  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #23 pc 00146979  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QAbstractButton::mouseReleaseEvent(QMouseEvent*)+88)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #24 pc 0019d509  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QToolButton::mouseReleaseEvent(QMouseEvent*)+4)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #25 pc 00100bbd  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QWidget::event(QEvent*)+536)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #26 pc 0019d57d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QToolButton::event(QEvent*)+50)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #27 pc 000e2a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::notify_helper(QObject*, QEvent*)+104)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #28 pc 000e5583  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplication::notify(QObject*, QEvent*)+1382)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #29 pc 001ae40f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::notifyInternal(QObject*, QEvent*)+62)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #30 pc 000e4d5b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&lt;QWidget&gt;&amp;, bool)+286)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #31 pc 0010a19b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #32 pc 0010a8d3  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #33 pc 000e2a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::notify_helper(QObject*, QEvent*)+104)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #34 pc 000e5e53  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplication::notify(QObject*, QEvent*)+3638)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #35 pc 001ae40f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::notifyInternal(QObject*, QEvent*)+62)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #36 pc 000a09cd  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)+516)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #37 pc 000a06ed  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent*)+3492)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #38 pc 000a1b13  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)+382)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #39 pc 00093181  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QWindowSystemInterface::sendWindowSystemEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)+20)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #40 pc 00028135  /data/data/org.qtproject.example.TouchImage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #41 pc 001ad533  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QEventLoop::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)+14)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #42 pc 001adc13  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)+226)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #43 pc 001b2527  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::exec()+82)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #44 pc 00012a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libTouchImage.so (main+48)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #45 pc 000190b5  /data/data/org.qtproject.example.TouchImage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #46 pc 00016baf  /system/lib/libc.so (__pthread_start(void*)+30)
  F/art     ( 6837): art/runtime/runtime.cc:289]   native: #47 pc 00014af3  /system/lib/libc.so (__start_thread+6)
  F/art     ( 6837): art/runtime/runtime.cc:289]   (no managed stack frames)
  F/art     ( 6837): art/runtime/runtime.cc:289] Pending exception android.content.ActivityNotFoundException thrown by 'unknown throw location'
  F/art     ( 6837): art/runtime/runtime.cc:289] android.content.ActivityNotFoundException: No Activity found to handle Intent {  }
  F/art     ( 6837): art/runtime/runtime.cc:289]   at void android.app.Instrumentation.checkStartActivityResult(int, java.lang.Object) (Instrumentation.java:1781)
  F/art     ( 6837): art/runtime/runtime.cc:289]   at android.app.Instrumentation$ActivityResult android.app.Instrumentation.execStartActivity(android.content.Context, android.os.IBinder, android.os.IBinder, android.app.Activity, android.content.Intent, int, android.os.Bundle) (Instrumentation.java:1501)
  F/art     ( 6837): art/runtime/runtime.cc:289]   at void android.app.Activity.startActivityForResult(android.content.Intent, int, android.os.Bundle) (Activity.java:3745)
  F/art     ( 6837): art/runtime/runtime.cc:289]   at void android.app.Activity.startActivityForResult(android.content.Intent, int) (Activity.java:3706)
  F/art     ( 6837): art/runtime/runtime.cc:289] Dumping all threads without appropriate locks held: thread list lock mutator lock
  F/art     ( 6837): art/runtime/runtime.cc:289] All threads:
  F/art     ( 6837): art/runtime/runtime.cc:289] DALVIK THREADS (16):
  F/art     ( 6837): art/runtime/runtime.cc:289]   (no managed stack frames)
  &lt;&lt; lot more lines of log here &gt;&gt;
  F/libc    ( 6837): Fatal signal 6 (SIGABRT), code -6 in tid 6882 (QtThread)
  </code></pre>
  
  <p>This occures after QtAndroid::startActivity and before MyReceiver::handleActivityResult (debugger says so).
  What is more, there are warnings/errors during program starts, but it does not cause program abborting:</p>
  
  <pre><code>W/linker  ( 4449): libQt5Gui.so: unused DT entry: type 0x1d arg 0x4c19d
  W/linker  ( 4449): libQt5Widgets.so: unused DT entry: type 0x1d arg 0x6a769
  W/linker  ( 4449): libQt5Svg.so: unused DT entry: type 0x1d arg 0x8f18
  W/linker  ( 4449): libQt5AndroidExtras.so: unused DT entry: type 0x1d arg 0x5044
  W/linker  ( 4449): libqtforandroid.so: unused DT entry: type 0x1d arg 0x8cac
  I/Qt      ( 4449): qt start
  W/System.err( 4449): java.lang.NoSuchFieldException: mInsetState
  W/System.err( 4449):    at java.lang.Class.getDeclaredField(Class.java:890)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getAccessibleField(ExtractStyle.java:405)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getDrawable(ExtractStyle.java:1103)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getLayerDrawable(ExtractStyle.java:629)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getRippleDrawable(ExtractStyle.java:820)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getDrawable(ExtractStyle.java:1028)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.extractViewInformations(ExtractStyle.java:1187)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.extractTextAppearanceInformations(ExtractStyle.java:1336)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.&lt;init&gt;(ExtractStyle.java:2017)
  W/System.err( 4449):    at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:438)
  W/System.err( 4449):    at java.lang.reflect.Method.invoke(Native Method)
  W/System.err( 4449):    at java.lang.reflect.Method.invoke(Method.java:372)
  W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
  W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
  W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
  W/System.err( 4449):    at android.app.Activity.performCreate(Activity.java:5990)
  W/System.err( 4449):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
  W/System.err( 4449):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
  W/System.err( 4449):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
  W/System.err( 4449):    at android.app.ActivityThread.access$800(ActivityThread.java:151)
  W/System.err( 4449):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
  W/System.err( 4449):    at android.os.Handler.dispatchMessage(Handler.java:102)
  W/System.err( 4449):    at android.os.Looper.loop(Looper.java:135)
  W/System.err( 4449):    at android.app.ActivityThread.main(ActivityThread.java:5254)
  W/System.err( 4449):    at java.lang.reflect.Method.invoke(Native Method)
  W/System.err( 4449):    at java.lang.reflect.Method.invoke(Method.java:372)
  W/System.err( 4449):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
  W/System.err( 4449):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  W/System.err( 4449): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Field.get(java.lang.Object)' on a null object reference
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getDrawable(ExtractStyle.java:1103)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getLayerDrawable(ExtractStyle.java:629)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getRippleDrawable(ExtractStyle.java:820)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getDrawable(ExtractStyle.java:1028)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.extractViewInformations(ExtractStyle.java:1187)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.extractTextAppearanceInformations(ExtractStyle.java:1336)
  W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.&lt;init&gt;(ExtractStyle.java:2017)
  W/System.err( 4449):    at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:438)
  W/System.err( 4449):    at java.lang.reflect.Method.invoke(Native Method)
  W/System.err( 4449):    at java.lang.reflect.Method.invoke(Method.java:372)
  W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
  W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
  W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
  W/System.err( 4449):    at android.app.Activity.performCreate(Activity.java:5990)
  W/System.err( 4449):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
  W/System.err( 4449):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
  W/System.err( 4449):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
  W/System.err( 4449):    at android.app.ActivityThread.access$800(ActivityThread.java:151)
  W/System.err( 4449):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
  W/System.err( 4449):    at android.os.Handler.dispatchMessage(Handler.java:102)
  W/System.err( 4449):    at android.os.Looper.loop(Looper.java:135)
  W/System.err( 4449):    at android.app.ActivityThread.main(ActivityThread.java:5254)
  W/System.err( 4449):    at java.lang.reflect.Method.invoke(Native Method)
  W/System.err( 4449):    at java.lang.reflect.Method.invoke(Method.java:372)
  W/System.err( 4449):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
  W/System.err( 4449):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  &lt;&lt; more lines of log here &gt;&gt;
  W/linker  ( 4449): libTouchImage.so: unused DT entry: type 0x1d arg 0x8efc
  W/Qt A11Y ( 4449): Could not activate platform accessibility.
  </code></pre>