From ce8f85f33eae30c7b70bbbcd395cea457c7e2f8f Mon Sep 17 00:00:00 2001 From: Victor K Date: Mon, 22 Feb 2016 11:43:01 +0300 Subject: [PATCH] set music volume control as default --- .../android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java index 75b4f95e21..9981f9b8c0 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java @@ -29,6 +29,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.graphics.PixelFormat; +import android.media.AudioManager; import android.opengl.GLSurfaceView; import android.os.Build; import android.os.Bundle; @@ -281,6 +282,8 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe Window window = this.getWindow(); window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); + + this.setVolumeControlStream(AudioManager.STREAM_MUSIC); } //native method,call GLViewImpl::getGLContextAttrs() to get the OpenGL ES context attributions