Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How do I set a custom class in a java function signature?
Forum Updated to NodeBB v4.3 + New Features

How do I set a custom class in a java function signature?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 197 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AcNas
    wrote on 16 Mar 2021, 06:22 last edited by
    #1

    Good afternoon. I try to pass a custom class to the function signature, but the debugger writes that it can't find it and the function is not executed. What am I doing wrong?
    example.java

    package ru.acnas;
    
    import java.util.ArrayList;
    
    class ADevices extends ArrayList<Integer> {
       boolean _add(int val){return add(val);}
    }
    public class Example
    {
       public void setDevices(ADevices  devices){}
    }
    

    main.cpp

    #include <QAndroidJniObject>
    #include <QAndroidJniEnvironment>
    #include <QtAndroid>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QAndroidJniObject search("ru.acnas.Example")
        QAndroidJniObject test("ru.acnas.ADevices");
        search.callMethod<void>("setDevices", "(Lru.acnas.ADevices;)V", test.object());
        return a.exec();
    }
    

    debugger

    W System.err: java.lang.NoSuchMethodError: no non-static method "Lru/acnas/Example;.setDevices(Lru.acnas.ADevices;)V"
    W System.err: 	at org.qtproject.qt5.android.QtNative.startQtApplication(Native Method)
    W System.err: 	at org.qtproject.qt5.android.QtNative$7.run(QtNative.java:620)
    W System.err: 	at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
    W System.err: 	at java.lang.Thread.run(Thread.java:923)
    
    1 Reply Last reply
    0

    1/1

    16 Mar 2021, 06:22

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved