Unable to set volume on BlackBerry Playbook

I have a problem with changing the volume of a Blackberry game book. First, I repackage my Android app into a Palybook app. I need to change the volume of a Blackberry game book using seekbar and the seeklistener. I adjust the volume of the audio manager. Here is the code:

audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE); seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { public void onStopTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub } public void onStartTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub } public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) { // TODO Auto-generated method stub audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress, 0); } 

But when I launch my application and change the search drum, the volume of the system (Blackberry playbook) does not change. This is due to the safety of the BlackBerry Palibooker

+8
java android volume blackberry-playbook
source share
1 answer

Are you sure you added these permissions?

 <uses-permission android:name="android.permission.WRITE_SETTINGS" ></uses-permission> <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" ></uses-permission> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" ></uses-permission> <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/> 

Also try this code

 while(audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) < progress) { audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI); 

}

+1
source share

All Articles