Qt Notification example, How to use it without making it the main activity in manifest?



  • I want to be able to use the notification example provided by Qt without having to declare it as the main activity in the manifest. Link to Qt notification example is Here

    I already have another activity that i am using as the main activity called "MyCustomAppActivity", its code is here:

    package org.qtproject.example.notification;
    import org.qtproject.example.notification.R;
    import org.qtproject.qt5.android.bindings.QtActivity;
    import org.qtproject.qt5.android.bindings.QtService;
    import org.qtproject.example.notification.MyCustomAppService;
    import org.qtproject.example.notification.NotificationClient;
    import android.content.Intent;
    import android.util.Log;
    import android.os.Bundle;
    
    public class MyCustomAppActivity extends QtActivity {
        @Override
        public void onCreate(Bundle bundle) {
            super.onCreate(bundle);
            Log.i("Activity", "Starting service!");
            Intent serviceIntent = new Intent(this, org.qtproject.example.notification.MyCustomAppService.class);
            startService(serviceIntent);
        }  
    }
    

    Or if that is not possible, then I want to be able to launch the service from the notification class and I will no longer need "MyCustomAppActivity" class, and I will put the Qt notification class as the main activity in the manifest. How can I do that?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.