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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:09:38+00:00 2026-05-27T12:09:38+00:00

OK I got it to work. This will save the file as a ringtone,

  • 0

OK I got it to work. This will save the file as a ringtone, notification, or alarm based on the context menu. (Only ringtone function is shown due to space conservation)

Need help with:

For some reason no sound plays after awhile.(about 20 or so presses and won’t play again until you back out of the app and launch it again) Also I’ve been told “/sdcard/media/etc” isn’t “the correct way” to do it.

If anyone has any suggestions on how to

1.release/pause/stop the sound from playing when the home button is pressed, a text is recieved, or the back button is pressed to exit the app, etc

and

2.the correct way to get the sdcard. I’d appreciate it.

MediaPlayer mp1;
MediaPlayer mp2;
MediaPlayer mp3;
MediaPlayer mp4;
MediaPlayer mp5;


protected void onDestroy() {
super.onDestroy();
if(mp1 != null){
    mp1.release();
}
if(mp2 != null){
mp2.release();
}
if(mp3 != null){
    mp3.release();
}
if(mp4 != null){
mp4.release();
}
if(mp5 != null){
    mp5.release();
}
}

protected void onPause() {
super.onPause();
if(mp1 != null){
    mp1.stop();
}
if(mp2 != null){
mp2.stop();
}
if(mp3 != null){
    mp3.stop();
}
if(mp4 != null){
mp4.stop();
}
if(mp5 != null){
    mp5.stop();
}
}
}

protected void onResume() {
super.onResume();

}
  • 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-27T12:09:38+00:00Added an answer on May 27, 2026 at 12:09 pm

    Answer to Q1: Add a onPause method to your activity and call MediaPlayer’s stop() method. You should also add a onDestroy method and call release to free the resources used by the mediaplayer.

    Answer to Q2: Take a look at this post. For more details read the Android Developers info on Data Storage

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can't work this out... I've got a .change event handler for multiple select boxes.
I'm trying to work through this guide to Rails routing , but I got
Has anybody got this to actually work? Documentation is non existent on how to
Here's what I got so far (that doesn't work). At this point I thought
I'm sorta at a loss to why this doesn't work considering I got it
I got this code that should help me save an image to the servers
At work we've got a roster that's historically been maintained in a huge Excel
At work, we just got a large number exotic cellular devices that need to
I got the acts_as_taggable_on_steroids plugin to work fine. The tag_cloud method in my view
I somehow got lumbered with deploying SharePoint at work. I hate it, even the

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.