0

Possible Duplicate:
Volume Control in android application

i m making an app for music player and i want to increase and decrease volume by using hardware buttons on mobile. so pls tell me any code to do this.

Community
  • 1
  • 1
akki
  • 405
  • 1
  • 6
  • 13

1 Answers1

0

TRY TO Use

 Context.getSystemService(Context.AUDIO_SERVICE) 

to get an instance of this class.

FOR MORE INFORMATION ,CLICK HERE

Annu
  • 532
  • 4
  • 8
  • 22
  • Try to use this "setVolumeControlStream(AudioManager.STREAM_MUSIC);" and put it in onCreate. – Annu Jan 13 '17 at 05:36