如果要調了以後,出現一個叮的聲音,我想應該只要再加 FLAG_PLAY_SOUND。
能調的東西,可以參考 AudioManager。
AudioManager am=null;
int amFlags;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
am = (AudioManager)getSystemService(AUDIO_SERVICE);
amFlags = AudioManager.FLAG_SHOW_UI;
Button button3 = (Button)findViewById( R.id.Button03 );
button3.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
am.adjustVolume( AudioManager.ADJUST_RAISE, amFlags );
}
});
Button button4 = (Button)findViewById( R.id.Button04 );
button4.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
am.adjustVolume( AudioManager.ADJUST_LOWER, amFlags );
}
});
}
沒有留言:
張貼留言