Questions tagged [ringtonemanager]

77 questions
1
vote
1 answer

Not able to display ringtones from /system/media/audio/ringtones

I am using following code to display ringtones : Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION |…
gaurav.28ch
  • 39
  • 2
  • 6
1
vote
0 answers

Setting audio file as Ringtone fails everytime

I know this answer has given many times and this is very simple question but some how I am not able to accomplish it. But trust me I have tried many other different solution but none worked for me, I am trying to set audio file to my LeEco Le2…
1
vote
1 answer

RingtoneManager is not able to play the tone after reading from res/raw folder in android

I have following code snippet for playing the tone that is saved in the res/raw folder. I can see the alert dialogue but the sound that I wanted to play is not happening. What mistake I am doing here? if(min < thresHold) { …
1
vote
1 answer

Android Dialog box not showing

I am developing a app for Android. I have a method called ringtone that is called when certain conditions are met. I wanted to create a lound sound and create a dialog box to dismiss the sound. My code: public void ringtone() { …
0
votes
0 answers

I am unable to set ringtone using activity in android studio?

Sometimes it returns that unsupported mimetype and sometimes it returns invalid token try to set ringtone in my app. But I am unable to do so by all mean I tried. I checked others code but I am not make it possible for me from others code. even all…
0
votes
0 answers

How to set ringtone in Android from my activity on upcoming Android 14 (UPSIDE_DOWN_CAKE API 34)?

I'm trying to find a way to set a new default ringtone by code from my Android activity. It works well on Android 13 but on Android 14+ on Android Studio Emulator (for example Nexus 6P API 34) the app crashes. My code is below: interface Tone{ …
0
votes
1 answer

The application does not work on newer versions of Android (version 9 and above)

This application sets the tones, but it stops working in storing the tone on the newer versions and works efficiently on the old versions. I would like your help to solve the problem I think the storage path has been changed for the latest…
0
votes
1 answer

How to retrieve the original default ringtone that came with the Android device?

I'm trying to retrieve the first default ringtone that was present on an Android phone when it was initially bought. I've tried using RingtoneManager.getDefaultUri() and RingtoneManager.getActualDefaultRingtoneUri() methods, but they don't seem to…
Rdog420
  • 1
  • 1
0
votes
0 answers

Android Ringtone Setting Error | URI Error

I have downloaded ringtone file to Storage/RIngtones/file.mp3 Now I have converted into File to URI and setting for ringtones, But I am getting error. My code is as given below : var mimeType =…
Ramesh Solanki
  • 2,961
  • 4
  • 28
  • 44
0
votes
1 answer

Setting ringtone to different sim cards Android

I am using setActualDefaultRingtone but it is only setting ringtone to sim one. Is there any way to set ringtone to sim 2.
Tariq Hussain
  • 409
  • 1
  • 5
  • 19
0
votes
1 answer

Android Kotlin get result of implicit intent RingtoneManager and use it later

It´s my first app with implicit intent and i´m trying to work with it with my books and android referenz for kotlin. Now i got a problem on working with the result of an intent. i created a button OnClick at the button it starts…
Da_Pusti
  • 5
  • 3
0
votes
1 answer

Stop ringtone of broadcastReceiver from an activity kotlin

I've already tried similar question stop alarm from ringing in another activity. However, it didn't work in my case. What I want to achieve is: When notification fires, ringtone starts in broadcast receiver. If device is on, user can stop ringtone…
Tieria
  • 333
  • 3
  • 11
0
votes
1 answer

How to simply set the default alarm tone to a custom tone

My app currently uses the default alarm ringtone for certain events, which is realized using the following two lines of code in onCreate(): Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM); ringtone =…
Jonathan
  • 63
  • 6
0
votes
1 answer

java.lang.IllegalArgumentException: Invalid column: _data

while running this code I am getting invalid: column _data exception RingtoneManager.setActualDefaultRingtoneUri( context, RingtoneManager.TYPE_RINGTONE, Settings.System.DEFAULT_RINGTONE_URI) basically I want to…
0
votes
0 answers

Is there any way to set specific contact ringtone on android 10

I'm trying to set ringtone to specific contact for android 10 but it's not working. I'm getting mp3 file uri and specific contact uri using contact id and passing both to content resolver update function. i've tried many methods both nothing is…