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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:21:29+00:00 2026-05-13T12:21:29+00:00

On Android, I’m having a problem trying to figure out which ringtone is actually

  • 0

On Android, I’m having a problem trying to figure out which ringtone is actually playing (I’m not trying to detect the default ringtone, but the one actually playing as it may be different due to user setting a particular ringtone for a particular contact).

I’m using the Ringtone.isPlaying() function as I cycle through (successfully) all the available Ringtones from the RingtoneManager. However none of them ever returns true to Ringtone.isPlaying()! Anyone have a clue what I am doing wrong? Here is the code sample that is definitely being run whilst the ring is playing:

RingtoneManager rm = new RingtoneManager(this); // 'this' is my activity (actually a Service in my case)
if (rm != null)
{
    Cursor cursor = rm.getCursor();
    cursor.moveToFirst();
     for (int i = 0; ; i++)
     {
            Ringtone ringtone = rm.getRingtone(i);  // get the ring tone at this position in the Cursor
            if (ringtone == null)
            break;
        else if (ringtone.isPlaying() == true)
                return (ringtone.getTitle(this));   // *should* return title of the playing ringtone
    }
    return "FAILED AGAIN!"; // always ends up here
}
  • 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-13T12:21:30+00:00Added an answer on May 13, 2026 at 12:21 pm

    If you look at the source of Ringtone you can see that the isPlaying() method only cares about that particular instance of Ringtone.

    When you call getRingtone() from RingtoneManager() it creates a new Ringtone object (source). So this will not be the same Ringtone object used to play a sound when someone calls (if Ringtone objects are used to do that) so isPlaying() will always return false in your case.

    isPlaying() will only ever return true if you have called play() on that specific Ringtone object.

    As each application creates its own MediaPlayer objects I don’t think you can monitor which sounds other applications are currently playing.

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

Sidebar

Related Questions

Android 4.0 phones only have virtual buttons, which actually go invisible when playing youtube/video
Android APK-Files are not binaries but byte-code-files. So is it possible to install the
Android stores it's programs in APK format, which is a modified version of ZIP/JAR.
Android SDK Manager complains WARNING: Java not found in your path. Instead of using
Android 2.1 - Eclipse What steps will reproduce the problem? 1. Create new Texture(managed)
Android opengl-es view question. So in openGL, the default position of the camera and
android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed error in my application and not sure why.
android:label parameter is displayed just under your icon on the home screen, but I
Android does not support ad-hoc WiFi networks. My question is, how can it distinguish
Android does not allow native apps like Phonegap-based apps to write binary files. A

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.