Color of staus- and navigationbar on android
-
Hello everyone,
I am new to this forum and recently started learning Qt. I am working on an app for andriod to learn the mechanics. Unfortunately, I couldn't find a way to change the color of the status- and navigationbar while the app is being used on the andriod device.
I found out that before there was a way with
"QtAndroid::runOnAndroidThread" but I think it was replaced by :"QAndroidApplication::runOnAndroidMainThread(const std::function<QVariant ()> &runnable, const QDeadlineTimer timeout = QDeadlineTimer::Forever)" .
Unfortunately I have not found any examples for the use of this code on the internet (only the explanation here https://doc-snapshots.qt.io/qt6-dev/qnativeinterface-qandroidapplication.html#runOnAndroidMainThread) and I would be especially interested in the use to change the color of the status- and navigationbar. I have no idea where to put the code and how to change the color of the bars with it.
I would appreciate any help on this.
Have a nice weekend. -
As far as I see and as far as I know the Notification Example, it does not extend QtActivity.
It uses a static java method which is also the key, why that example is rather simple and not a gate to solve all problems. Some things can´t be called from a static context. I experienced that with getWindow() on my journey to set the FLAG_SHOW_WHEN_LOCKED. I also tried a singelton pattern to access non-static methods from a static context, which also doesn´t work for my goal.Using non static methods requires to create an instance of that java class and when that class extends QtActivity I found things to become tricky by resulting in a problem "that it can´t be called from the worker thread, but has to be in the GUI thread" -> That is dangerous half-knowledge I´m posting which relates to my recent problems and googling activities the last days.
Furthermore it might be important, if we´re talking about Qt6 or 5.
As far as I understood it, QT6 isn´t fully featured yet and in it´s current most upto-date version 6.6 still missing "androidextras" - so probably some feature known from Qt5 are not available yet.
https://doc.qt.io/qt-6/whatsnewqt6.html -
@Luffy97 Since I think a three days Qt6.6 is out. I don´t know on which version you´re running, before 6.6 I updated from 6.3 to 6.5 which at least gave me Bluetooth access on Android :)
I used the Qt maintenance tool to do that. -