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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:06:12+00:00 2026-05-26T01:06:12+00:00

I have tried to make an application in android to play, pause and stop

  • 0

I have tried to make an application in android to play, pause and stop a song with one button only.

Can anyone show me how can I make that application?

  • 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-26T01:06:13+00:00Added an answer on May 26, 2026 at 1:06 am
    final Button bPlay = (Button)findViewById(R.id.bPlay);
                MediaPlayer song1 = MediaPlayer.create(tutorialFour.this, R.raw.fluet);
            Button bStop = (Button)findViewById(R.id.bStop);
            bPlay.setWidth(10);
            song1.setOnCompletionListener(new OnCompletionListener() {
    
                public void onCompletion(MediaPlayer mp) {
    
                    bPlay.setText("Play");
    
    
                }
            });
            bPlay.setOnClickListener(new View.OnClickListener() {
    
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    b=true;
    
                    if(bPlay.getText().equals("Play") && b==true)
                    {
    
                        song1.start();
    
                        bPlay.setText("Pause");
                        b=false;
                    }
    
                    else if(bPlay.getText().equals("Pause"))
                    {
                        x=song1.getCurrentPosition();
                        song1.pause();
                        bPlay.setText("Resume");
                        Log.v("log",""+x);
                        b=false;
                    }
                    else if(bPlay.getText().equals("Resume") && b==true)
                    {
                        song1.seekTo(x);
                        song1.start();
                        bPlay.setText("Pause");
                        b=false;
                    }
    
    
                }
    
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need to make an android application to show a calendar control. I have
I have tried to make the fullscreen feature of a SDI application with splitter
I have a Button that I am using 13 times in my Android application's
I just got started today developing for Android. I tried to make an application
I have a Motorola Defy OS Android 2.1 and I make an application with
I am developing an android application in which I have to make a layout.I
We have developed one android application which will send the request and receive the
I have just started Android Development, I want to make thread in my application
I have tried to make a webservice interface to a state-holding COM component. The
How do I make the following url forbidden in apache; main/index.php?site=ing I have tried

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.