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

  • Home
  • SEARCH
  • 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 7601269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:07:37+00:00 2026-05-30T23:07:37+00:00

UPDATE: so i am using seekbar and Seekbar and hook up the listeners onCreate

  • 0

UPDATE:

so i am using seekbar and Seekbar and hook up the listeners

onCreate method:

audio = (AudioManager)  this.getSystemService(Context.AUDIO_SERVICE); 
volume_label.setText(String.valueOf(volume));*/ 
volumebar.setMax(audio.getStreamMaxVolume(AudioManager.STREAM_MUSIC)); 
volumebar.setProgress(60); 
volumebar.setOnSeekBarChangeListener(VolumeChange); 

this.setVolumeControlStream(AudioManager.STREAM_MUSIC);


private OnSeekBarChangeListener VolumeChange = new  OnSeekBarChangeListener()
    { 
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
        { 
            int index = seekbar.getProgress(); 
             audio.setStreamVolume(AudioManager.STREAM_MUSIC, index, 1); 
           //  volume_label.setText(String.valueOf(index)); 
        } 
        public void onStartTrackingTouch(SeekBar seekBar) 
        {
            //
        } 

        public void onStopTrackingTouch(SeekBar seekBar) 
        {
            //
        } 
    };

but i can use the seeker but does not effect the audio sound, try to increase and decrease the sound but no effect, what else should i be implementing?

UPDATE END

I am working on a MediaPlayer which has play/pause/prev/next/seeker everything works as expected and I am planning to add volume slider so user can change the volume instead of using hardware volume up/down buttons.

i tried this code but did not show-up on the UI like.

Inside onCreate Method:

Activity.setVolumeControlStream(AudioManager.STREAM_MUSIC)  

AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 40, AudioManager.FLAG_PLAY_SOUND);
  • 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-30T23:07:38+00:00Added an answer on May 30, 2026 at 11:07 pm

    Hope this helps other… here is how i able to achieved:

      leftAm = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
        int maxVolume = leftAm.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
        int curVolume = leftAm.getStreamVolume(AudioManager.STREAM_MUSIC);
        SeekBar volControl = (SeekBar)findViewById(R.id.leftVolume);
        volControl.setMax(maxVolume);
        volControl.setProgress(curVolume);
        volControl.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
    
    
        @Override
        public void onStopTrackingTouch(SeekBar arg0) {
         // TODO Auto-generated method stub
        }
    
        @Override
        public void onStartTrackingTouch(SeekBar arg0) {
         // TODO Auto-generated method stub
        }
    
        @Override
        public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {
         // TODO Auto-generated method stub
         leftAm.setStreamVolume(AudioManager.STREAM_MUSIC, arg1, 0);
        }
       });  
    

    .xml:

    <SeekBar
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:id="@+id/volumebar"
                android:max="100"
                android:paddingBottom="10dip"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I properly setup the callback method for a status update using the
At the moment I'm using the post method like this $.ajax({ type: POST, url:
I'm trying to request a single location update using the new LocationManager.requestSingleUpdate() method, but
I'm trying to update using mysql_query in php and it gives me this error:
I'm using this tutorial to create a full screen background. (UPDATE: Using height and
I'm having trouble getting this <div> to automatically update using jQuery. It's essentially a
****Update:** using the Rank() over partition syntax available in MS SQL Server 2005 does
What is the best way to communicate with another process in PHP? Update: Using
I am trying to implement an update statement using a prepared statement in a
Do you know any documentation about the rules of using update sites? I have

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.