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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:06:00+00:00 2026-05-13T23:06:00+00:00

I currently start a Ringtone on Android and it plays fine. However when I

  • 0

I currently start a Ringtone on Android and it plays fine.

However when I try to stop the ringtone it doesn’t stop or atleast doesn’t stop straight away, it will keep in playing until it just plays out.

Here is how I set up the Ringtone:

int rm = audio_service.getRingerMode();
int vs = audio_service.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER);

android.os.Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

if ((rm == AudioManager.RINGER_MODE_VIBRATE ||
    (rm == AudioManager.RINGER_MODE_NORMAL && vs == AudioManager.VIBRATE_SETTING_ON)))
            v.vibrate(vibratePattern,1);

if (audio_service.getStreamVolume(AudioManager.STREAM_RING) > 0) {                          

    oRingtone = RingtoneManager.getRingtone(this, Settings.System.DEFAULT_RINGTONE_URI);
    oRingtone.setStreamType(AudioManager.STREAM_RING);
    oRingtone.play();       

    }

And here is how I try to stop it

if (CallDialogActivity.oRingtone != null) {
      Log.d("RINGTONE", "Into Ringtone if");
      Ringtone ringtone = CallDialogActivity.oRingtone;
      oRingtone = null;
      ringtone.stop();
}

Has anyone come across similiar problems or see any mistakes in my code?

EDIT:

Just to add I have added logging to see if ringtone.isPlaying() returns true or false after I call ringtone.stop() and it returns false, however the tone keeps playing for a couple of seconds (3 – 5 seconds) after before stopping

  • 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-13T23:06:01+00:00Added an answer on May 13, 2026 at 11:06 pm

    For anyone that comes across this:

    I had to use the RingTone manager to help stop the ringtone.

    Adding the following line sorted it out

    ringtoneManager.stopPreviousRingtone();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently about to start designing a new application. The application will allow a
I'm currently working on an app that will tell students when their classes start
Android question: I am currently in Activity A and inside of A I start
I currently have a Service that runs fine when I start it but when
I am currently using the meta http-equiv='Refresh' to automatic start PDF downloads. however this
When I start debugging the project we are currently working on, the program window
I currently have interfaces much like the following: interface IService { void Start(); IHandler
To start, I know there are two kinds of JSON serialization currently built into
The software group I currently work in has recently decided to start documenting our
Currently, I am calculating a finish date based on the start date (DateTime) and

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.