Qt6.5 / Android -> Get App on top of LockScreen
-
Aloá,
first I describe what my goal is an then, how I approached it until now.
If someone knows a different way to do it - I´d buy that :)Goal:
I want the App on Android to be in front of the LockScreen, since it has the function of an Alarm-Clock. I already managed to start it at a scheduled time, but haven´t achieved yet to put it in front of the LockScrren.Current Approach:
My current approach is to do following in a java class:getWindow().setFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED, WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
This requires the java class to extend ...QtActivity.
=>
Therefore in turn I can´t make the class static, because getWindow() can´t be called from a static context.
Furthermore it seems, when extending ...QtActivity" I can not simply create an instance of that java class in the c++ code in the fashionmyCl = env.findClass("org/qtproject/example/androidnotifier/OverlayAppToLockScreen"); obj = QJniObject(myCl, "()V"); obj.callObjectMethod("org/qtproject/example/androidnotifier/OverlayAppToLockScreen","OverLayApp", "()V");
because when extending QtActivity the methods can´t be called from the c++ code I write the App in, since that in turn runs in the worker thread (?).
And that exceeds my horizon how to solve that.Does someone has an idea?
-
I´m wondering, if there could be a way via an Intent. In sense of forming an Intent which - descriptivly spoken - says
"Hey Hello Android OS, look for an App called "MyApp" and pass it the Intention with a payload to make the flag "FLAG_SHOW_WHEN_LOCKED " to be set"