Code example for RingtoneManager

Methods: getRingtonegetRingtonePositionsetType

3
        final String s = settings.getRingtone();
        if ((s == null) || "".equals(s)) {
            return; 
        } 
 
        final RingtoneManager manager = new RingtoneManager(this);
        manager.setType(RingtoneManager.TYPE_ALL);
        ringtone = manager.getRingtone(manager.getRingtonePosition(Uri.parse(s)));
        if (ringtone == null) {
            return; 
        } 
 
        // TODO: AnnouncifySettings using ContentProvider 
        ringtone.setStreamType(new AnnouncifySettings(this).getStream());
        ringtone.play();
    } 
 
    protected void stopRingtone() { 
        if (ringtone != null) {
            ringtone.stop();
Stop searching for code, let great code find you!  Add Codota to your java IDE