title: Not possible in C++ to retrieve the value of jlong from java context using QAndroidJniObject JNI. Exception java.lang.NoSuchMethodError
body: <p>In the C++ context, it is not possible to retrieve the value of jlong when calling a function from the java context using the QAndroidJniObject JNI. Only the jstring value is retrieved. How to extract jlong? How can this be done? Maybe I need on JNI extern C to pass instead of QAndroidJniObject if it is possible in Qt?</p>
  <pre><code>//----------In Java context:
  package com.sim.lib.operation.OperationData
  
  public class OperationData {
      private final String mID;
      private Long mAmount;
      public String getID() {
          return this.mID;
      }
      public Long getAmount() {
          return this.mAmount;
      }
      OperationData(){
          this.mAmount = 55;
          this.mID = &quot;someid111&quot;;
      }
  }
  //----------In Java context:
  //other package
  import com.sim.lib.operation.OperationData
  public static native void approvedStatusSendToQt(java.lang.Object statusObj);
  OperationData mOperationData = new OperationData();
  approvedStatusSendToQt((Object)mOperationData);
  //------------------------------------------------In C++ context:
  void AndroidClass::registerNatives()
  {
      JNINativeMethod methods[] {
          {&quot;approvedStatusSendToQt&quot;, &quot;(Ljava/lang/Object;)V&quot;,reinterpret_cast&lt;void *&gt;(onOperationStatusApprovedReceived)}
      }
  //.....register method
  };
  static void onOperationStatusApprovedReceived(JNIEnv *env, jobject /*thiz*/,jobject statusObj)
  {
        QAndroidJniObject callbackObj(statusObj);
  qDebug()&lt;&lt;&quot;mId&quot;&lt;&lt;callbackObj.callObjectMethod&lt;jstring&gt;(&quot;getID&quot;).toString(); //Print  &quot;someid111&quot; it's ok
  qDebug()&lt;&lt;&quot;mAmount&quot;&lt;&lt; callbackObj.callMethod&lt;jlong&gt;(&quot;getAmount&quot;, &quot;()J&quot;); //Print exception  System.err: java.lang.NoSuchMethodError: no non-static method &quot;Lcom/sim/lib/operation/OperationData;.getAmount()J&quot;
  //qDebug()&lt;&lt;&quot;mAmount&quot;&lt;&lt; callbackObj.callMethod&lt;jlong&gt;(&quot;getAmount&quot;);//the same mistake 
  }
  </code></pre>