over 9 years ago
You can play android device's default notification sound using RingtoneManager:
- try {
- Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
- Ringtone r = RingtoneManager.getRingtone(getApplicationContext(),notification);
- r.play();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
try { Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Ringtone r = RingtoneManager.getRingtone(getApplicationContext(),notification); r.play(); } catch (Exception e) { e.printStackTrace(); }
0 Comment(s)