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 6639711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:35:10+00:00 2026-05-25T23:35:10+00:00

I am working in an android tab which has tabs activities, I have made

  • 0

I am working in an android tab which has tabs activities, I have made tab groups for every tabs, in one activity i have media player for playing audio song. everything is fine except
i cann’t control the volume of media player and I am not seeing volume control dialog of android device. here is my code,

mp=new MediaPlayer();
             mp.setWakeMode(getParent(), PowerManager.PARTIAL_WAKE_LOCK); //for powermanagement
    try {
                if(GlobalConfig.notInternet==true)
                {
                     mp.setDataSource("/sdcard/abc/"+file);
                }else{
                    mp.setDataSource(url2);
                }
                mp.prepare();

            } catch (IllegalArgumentException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
    }
    mp.start();

please help me. thanks in advance

  • 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-25T23:35:10+00:00Added an answer on May 25, 2026 at 11:35 pm

    The following code should be used to managing media sound…

      AudioManager mAudioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
    
      //It gives max volume of ur device   
    
      int max_volume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
    
      //It gives current volume of device
    
       int current_volume=mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC));
       //Here you can set volume 
       int progress=your set value;
       mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,progress, 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app on android market which was working fine on tab before.
So I have my tab layout working as demonstrated in the Android example :
I have a tabactivity with several tabs. Each tab has an ActivityGroup associated with
In my application I have a tab bar. It contains four tabs in which
I'm working on Android application which have two different tabhost : Main and Child.
I m developin Tab based Application in which first activity contain one edit text
I have an application with tabs. In one tab I need to put data
I have set up a MapView Class which has Overlays (and they're working fine.)
I'm working on an Android application with an activity that uses a tab layout.
I am working on an Android App and I have used android FragmentPager tabs

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.