Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4620918
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:37:34+00:00 2026-05-22T02:37:34+00:00

i used this code to adjust volume but it didn’t work int volume=23; audio.setStreamVolume(AudioManager.STREAM_RING,volume,

  • 0

i used this code to adjust volume but it didn’t work

int volume=23;
audio.setStreamVolume(AudioManager.STREAM_RING,volume, AudioManager.FLAG_PLAY_SOUND|AudioManager.FLAG_ALLOW_RINGER_MODES);}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:37:35+00:00Added an answer on May 22, 2026 at 2:37 am

    you should not just set the volume to 23 instead you should first make a call to getStreamMaxVolume(StreamType) to get the max volume possible for the StreamType which in this case is the ringer’s volume.

    for example, to set the ringer’s volume to max you do this!

    audioManager.setStreamVolume(AudioManager.STREAM_RING, audioManager.getStreamMaxVolume(AudioManager.STREAM_RING), FLAG_ALLOW_RINGER_MODES|FLAG_PLAY_SOUND);
    

    UPDATES

        int streamMaxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_RING);
        Toast.makeText(this, Integer.toString(streamMaxVolume), Toast.LENGTH_LONG).show(); //I got 7
        audioManager.setStreamVolume(AudioManager.STREAM_RING, streamMaxVolume, AudioManager.FLAG_ALLOW_RINGER_MODES|AudioManager.FLAG_PLAY_SOUND);
    

    ok. now that i am at home i can try out codes. here as you can see, streamMaxVolume gives me a integer of 7. if you try to set it to 23 its way too much. so the possible values you can use in setStreamVolume in my case is

    0, 1, 2, 3, 4, 5, 6, 7
    Lowest <—–> Highest

    //set to lowest ->
    audioManager.setStreamVolume(AudioManager.STREAM_RING, 0, AudioManager.FLAG_ALLOW_RINGER_MODES|AudioManager.FLAG_PLAY_SOUND);
    
    //set to loudest ->
    audioManager.setStreamVolume(AudioManager.STREAM_RING, 7, AudioManager.FLAG_ALLOW_RINGER_MODES|AudioManager.FLAG_PLAY_SOUND);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code used to work but doesnt any more. i used a breakpoint, and
I have used this code for extracting urls from web page.But in the line
This code used to return my local ip address as 192.xxx.x.xxx but now it
...at least to me. This code used to work fine. I'm pretty sure nothing
this code in my plugin used to work just fine: jQuery('#embedded_obj', context).get(0).getVersion(); and the
I used this code to place my admob ads, but these code will show
i used this code to show uipicker in uiactionsheet but when i click close
I used this code to print the current page: <form> <input type=button value=Print onClick=window.print();
On a Vista dev machine I used this code successfully to change user Administrator
I am creating a rails app and have used this code in one of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.