ringtonemanager

android.media.Ringtone.play() stops working after a 28 plays

馋奶兔 提交于 2019-12-24 09:55:00
问题 I have an app that is open for hours and uses a background service with foreground notification attached to it. Every once in a while a sound is played using: try { Ringtone r = RingtoneManager.getRingtone(context, uri); r.play(); } catch (Exception e) { e.printStackTrace(); } The sounds are working, but after a while the sounds don't play anymore. No errors, no warnings, no crashes. Just no sound. My users are complaining as well, so it doesn't look like a device specific issue. Android Docs

Change ringtone picker dialog style

。_饼干妹妹 提交于 2019-12-24 03:30:52
问题 I am developing an application that has a notification at some point. I implemented a couple of methods to make possible for the user to change the notification sound. How do I change the style of the Ringtone Picker Dialog? This is my code for the ringtone picker: public void getNotification(){ Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION); intent.putExtra(RingtoneManager.EXTRA

does RingtoneManager.setActualDefaultRingtoneUri() work in API 23?

邮差的信 提交于 2019-12-10 21:03:39
问题 This is a simple question, and probably a simple answer but there is a huge amount of context. The Question: does setActualDefaultRingtoneUri() still work in API 23? because I can't get it to function The Context: I've set up AndroidManifest.xml with <uses-permission android:name="android.permission.WRITE_SETTINGS"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> The app self assigns the permissions with this code public void desirePermissionCode() { if (Build