Important: Please read the Qt Code of Conduct -

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

  • 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?

    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){}


    #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();


    W System.err: java.lang.NoSuchMethodError: no non-static method "Lru/acnas/Example;.setDevices(Lru.acnas.ADevices;)V"
    W System.err: 	at Method)
    W System.err: 	at$
    W System.err: 	at$
    W System.err: 	at

Log in to reply