Merge pull request #15096 from fnz/volume_control

Set music volume control as default
This commit is contained in:
minggo 2016-04-18 16:48:55 +08:00
commit 6cc80f28fc
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import android.content.Intent;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.PixelFormat; import android.graphics.PixelFormat;
import android.media.AudioManager;
import android.opengl.GLSurfaceView; import android.opengl.GLSurfaceView;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -281,6 +282,8 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
Window window = this.getWindow(); Window window = this.getWindow();
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); 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 //native method,call GLViewImpl::getGLContextAttrs() to get the OpenGL ES context attributions