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. Qt Notification example, How to use it without making it the main activity in manifest?
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 619 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.
  • M Offline
    M Offline
    Mena
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0

    • Login

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