I have an issue in changing the volume of blackberry play book. First I am repacking my Android App to Palybook App. I need to change the volume of blackberry playbook using seekbar and in seeklistener I am setting the Audio manager volume. 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 run my app and change the seekbar, the volume of the system(Blackberry playbook) does not change.is it due to blackberry palybook security
Are you sure you have 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);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With