qt for android 控制系统的不同音量
示例
QAndroidJniObject activity = QtAndroid::androidActivity();
QAndroidJniObject name = QAndroidJniObject::getStaticObjectField("android/content/Context","AUDIO_SERVICE","Ljava/lang/String;");
QAndroidJniObject service = activity.callObjectMethod("getSystemService","(Ljava/lang/String;)Ljava/lang/Object;",name.object<jstring>());
service.callMethod<void>("setStreamVolume", "(III)V", 5, 0, 4);
service.callMethod<void>("setStreamVolume", "(III)V", 3,15,4);
代码详解
AudioManager 参数详解
getSystemService 获取系统服务
service.callMethod(“setStreamVolume”, “(III)V”, 5, 0, 4); 设置通知音量
service.callMethod(“setStreamVolume”, “(III)V”, 3,15,4); 设置音乐视频等音量
上述链接有对 setStreamVolume 已经后面的参数如5,0,4的解释
原文地址:https://blog.csdn.net/qq_40116098/article/details/143478471
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!