How can I set volume level from ringtone instead of media volume level on MediaPlayer?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
setAudioStreamType(int)to set the media type to typeSTREAM_RING, then it should use the ringer volume instead of the defaultSTREAM_MUSIC.Note that you must do this before the media is prepared, so you’ll have to prepare it manually with
setDataSourceinstead of usingMediaPlayer.create().