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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:45:24+00:00 2026-06-01T15:45:24+00:00

My issue is that the code is not changing my Alarm tone, or the

  • 0

My issue is that the code is not changing my Alarm tone, or the tone for when I get a text message.

The following works:

       private void setRingTone(int RawId, String HumanName, String fileName)
   {

       Uri path = Uri.parse("android.resource://"+ getPackageName() +"/raw/" + fileName);

       RingtoneManager.setActualDefaultRingtoneUri(
               getApplicationContext(), RingtoneManager.TYPE_RINGTONE,
               path);  
       Log .i("TESTT", "Ringtone Set to Resource: "+ path.toString());

       RingtoneManager.getRingtone(getApplicationContext(), path)
               .play();

   }

However these 2 do not:

  1. private void setTextTone(int RawId, String HumanName, String fileName)
    {

       Uri path = Uri.parse("android.resource://"+ getPackageName() +"/raw/" + fileName);
    
       RingtoneManager.setActualDefaultRingtoneUri(
               getApplicationContext(), RingtoneManager.TYPE_NOTIFICATION,
               path);  
       Log .i("TESTT", "Ringtone Set to Resource: "+ path.toString());
    
       RingtoneManager.getRingtone(getApplicationContext(), path)
               .play();
    

    }

Does anyone know why the Notification does not change the sound of SMS messages, but Ringtone works. It is basically the same code??

EDIT I found something on Stack Overflow here (But I do Not understand it can someone clarify?) http://stackoverflow.com/questions/9545906/how-do-i-change-the-android-sms-tone-despite-of-current-sms-tone-setting

Thanks in Advance!

  • 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-06-01T15:45:25+00:00Added an answer on June 1, 2026 at 3:45 pm

    So the solution is to copy the sound from the raw folder into the sdcard and from there do the following:

      File k = new File(path, filename);
    
      ContentValues values = new ContentValues();
      values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
      values.put(MediaStore.MediaColumns.TITLE, "TwiAppclip");
      values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/*");
      values.put(MediaStore.Audio.Media.ARTIST, "cssounds ");
      values.put(MediaStore.Audio.Media.IS_RINGTONE, false);
      values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
      values.put(MediaStore.Audio.Media.IS_ALARM, false);
      values.put(MediaStore.Audio.Media.IS_MUSIC, false);
    
      Uri uri = MediaStore.Audio.Media.getContentUriForPath(k
           .getAbsolutePath());
       //do a delete here before inserting
      Uri newUri = getApplicationContext().getContentResolver().insert(uri, values);
    
      RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(),
          RingtoneManager.TYPE_RINGTONE, newUri);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In following code the issue is, that I cannot test dao.add() without using dao.list().size()
I am creating a repeating alarm. This works fine using the following code: Intent
My issue is with a certain style of code that very much resembles recursion,
I'm trying to track down an issue in our MFC code that looks like
An interesting issue came up recently. We came across some code that is using
Okay, of course it is possible, that's no issue. In my code I have
I'm running a weird issue here. I have code that makes jquery ajax calls
I have the code below that will open a modal window. This works in
Are there any understanding / maintainability issues that result from code like inVar1 ==
I'm having issues with a bit of code that I am writing in C#.

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.