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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:25:42+00:00 2026-05-25T01:25:42+00:00

i am trying to insert a audio file into the application which is not

  • 0

i am trying to insert a audio file into the application which is not showing any kind of error but while am running the program then it is showing some kind of exception that to force close kind of dialog box and here is my code

This is my first activity where am trying to invoke the button into the second activity playing the audio file.

public class Audio extends Activity {
    /** Called when the activity is first created. */

   @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button b2=(Button)findViewById(R.id.b1);
        b2.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent i1 =new Intent(Audio.this,Audio1.class);
                startActivity(i1);
            }
        });
    }
}



public class Audio1 extends Activity {
    private MediaPlayer eMediaPlayer= new MediaPlayer();

     public void onCreate(Bundle savedInstanceState) {

            super.onCreate(savedInstanceState);
            setContentView(R.layout.audio);
            eMediaPlayer=MediaPlayer.create(this, R.raw.ab);
            eMediaPlayer.start();

}
}
  1. audio is my xml file which is empty presently
  2. R.raw.ab is the resource file which is 830kb audio file
  • 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-25T01:25:43+00:00Added an answer on May 25, 2026 at 1:25 am

    you should call

    eMediaPlayer.prepare();
    

    before

    eMediaPlayer.start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to insert some import lines into a python source file, but i
I was trying to insert new data into an existing XML file, but it's
Trying to insert a large audio file into an Oracle 10g database and keep
Am trying to insert XML into XML Column.. getting following error: . Msg 6819,
I am trying to insert a time only value, but get the following error
I've been trying insert a MapView into an ActionBar Tab , but I wasn't
I am trying to insert items into a listbox in my asp.net C# application
Im trying to insert the userid into my table in a php file upload
im trying to insert data into a particular row in the database, but i
Trying to insert 315K Gif files into an Oracle 10g database. Everytime I get

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.