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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:22:26+00:00 2026-05-16T12:22:26+00:00

I have followed the steps to create my media player object but I cant

  • 0

I have followed the steps to create my media player object but I cant understand why it is not playing the music track. I used the following code:

mp = new MediaPlayer();
    mp.create(this, R.raw.testmed); 
    mp.setVolume(100, 100);


    mp.start();

but no sound is playing through the emulator, and furthermore when i check the method mp.isPlaying() it returns false. What have I missed?!

Many thanks

  • 1 1 Answer
  • 1 View
  • 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-16T12:22:27+00:00Added an answer on May 16, 2026 at 12:22 pm

    You have to call all methods necessary to actually start the player. Take a look at Android Media Player state diagram

    I think you need to prepare the player before starting. When the player is prepared, it can be started. This is done through a onPreparedListener:

    mp = new MediaPlayer();
    mp.create(this, R.raw.testmed);
    mp.setVolume(100, 100);
    mp.setOnPreparedListener(this);
    mp.prepare();
    

    Then you will need to define this and it should work:

    public void onPrepared(MediaPlayer player) {
       mp.start();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to GitHub, but I have followed the steps to create a
I'm using Xcode 4.3 and I have followed this user's steps to create the
Hello I have followed the steps in the links http://help.testflightapp.com/customer/portal/articles/402741-how-to-create-an-ipa-xcode-3- At step 4, when
I am using the authlogic gem for authentication. I have followed the steps at:
Does anybody have experience build app with PhoneGap's Build Service? I followed the steps
I have used vanilla Blueprint with Rails and it work very well. But when
I have started to working with phoneGap application for android. I followed the steps
I followed these steps: https://help.github.com/articles/generating-ssh-keys now, I want to create a folder in my
In trying to create a custom build for an application, I followed these steps
I have used Django File Upload Progress process for getting progress but getting error

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.