• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps random ringtone switcher

Abel M

Lurker
hi
i have been trying to create an app that randomly selects a ringtone from a playlist after a set delay time or a timer. but i really dont know where to begin or even how i might be able to change the ringtone.
 
RingtoneManager.setActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE, ringtoneUri);
 
i tried 'RingtoneManager.setActualDefaultRingtoneUri(this,RingtoneManager.TYPE_RINGTONE,Uri.parse("mnt/sdcard/music.mp3"));' i have the music in the emulator
but it didnt work.
i have this after the above and it plays the file so i know i got the path right
Ringtone rt = rm.getRingtone(this,Uri.parse("mnt/sdcard/music.mp3");
rt.play();
 
i tried to get permission too and the app didnt crash but when i tried to see if the ringtone changed by sending an incoming call it showed that nothing had changed. any suggesstions?
 
Back
Top Bottom