Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot set volume on BlackBerry Playbook

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

like image 885
User42590 Avatar asked Sep 22 '12 10:09

User42590


1 Answers

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);

}

like image 129
Kiran Kumar Avatar answered Nov 11 '22 00:11

Kiran Kumar