the volume control buttons now dontrol the media volume directly

This commit is contained in:
Dorian Zedler 2018-07-24 15:24:15 +02:00
parent 56b4e1352c
commit bc54bcd1ee
3 changed files with 8 additions and 1 deletions

View file

@ -4,5 +4,6 @@ public class StayAwake extends org.qtproject.qt5.android.bindings.QtActivity {
public void onCreate(android.os.Bundle savedInstanceState){ public void onCreate(android.os.Bundle savedInstanceState){
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
this.getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); this.getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
//this.getWindow().setVolumeControlStream(android.view.AudioManager.STREAM_MUSIC);
} }
} }

View file

@ -44,6 +44,9 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
QAndroidJniObject jactivity=QtAndroid::androidActivity();
if(jactivity.isValid())
jactivity.callMethod<void>("setVolumeControlStream","(I)V",3);
connectToDatabase(); connectToDatabase();

View file

@ -1,4 +1,8 @@
QT += quick sql QT += quick sql
android {
QT += androidextras
}
CONFIG += c++11 CONFIG += c++11
# The following define makes your compiler emit warnings if you use # The following define makes your compiler emit warnings if you use
@ -42,7 +46,6 @@ DISTFILES += \
android { android {
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources
Qt += androidextras
} }
HEADERS += \ HEADERS += \