Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Type casting QtActivity to customActivity?



  • I use Qt for Android 5.3 to make a small application.
    I've created a Java class named: CustomActivity extends from QtActivity, the Java code looks like this:
    @public class CustomActivity extends QtActivity
    {
    };@
    In C++ side, we can access the activity through QtAndroid::androidActivity( ) using QtAndroidExtras module. however when I stringify the activity( qDebug( "toString: %s", qPrintable( activity.toString( ) ) ); ), it is not what I desired: CustomActivity, but its super class QtActivity.
    I want to cast it into CustomActivity, how to do that?


Log in to reply