the volume control buttons now dontrol the media volume directly
This commit is contained in:
parent
56b4e1352c
commit
bc54bcd1ee
3 changed files with 8 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
3
main.cpp
3
main.cpp
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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 += \
|
||||||
|
|
Reference in a new issue