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. Pass ContextWrapper to java by modifiying notification example for Android

Pass ContextWrapper to java by modifiying notification example for Android

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 550 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.
  • W Offline
    W Offline
    walterAlex
    wrote on last edited by
    #1

    Hello I'm trying to modify the notification sample provided with QT ( at \QT5.4.1\Examples\Qt-5.4\androidextras\notification ) in order to use application's ContextWrapper object.
    Here's an example of a code I have as reference ( no QT just a fragment of a pure java app).

    public class DemoApplication extends Application {

    public void onCreate() {
        super.onCreate();
    
        GUIHelper.init(this); //  decalred as public static void init(ContextWrapper context)
        
    }
    

    }

    Now I need to do same thing but calling GUIHelper.init from inside of \QT5.4.1\Examples\Qt-5.4\androidextras\notification\android-sources\src\org\qtproject\example\notification\NotificationClient.java:

    public class NotificationClient extends org.qtproject.qt5.android.bindings.QtActivity
    {

    private static NotificationManager m_notificationManager;
    private static Notification.Builder m_builder;
    private static NotificationClient m_instance;
    private static EyeVerify _eyeverifier = null;
    
    
    public NotificationClient()
    {
        m_instance = this;
    	
    	
    }    
    

    public static void notify(String s) {

    	// pass ContextWrapper here
    	GUIHelper.init( ??? );
    
                ...
    

    }

    }

    As notify method is invoked from the c++ side I don't know where to obtain the ContextWrapper ( or Application ) instance to pass to GUIHelper.init.

    Any help will be appreciated
    Thanks in advance
    Walter

    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