Vote count:
0
I wanted to ask how I can get the inforamtion that a sound is set in notification sound list, for example I have this code where I check if the the sound that I want set is the default notification:
Ringtone ringtone = RingtoneManager.getRingtone(this,Settings.System.DEFAULT_NOTIFICATION_URI);
String name = ringtone.getTitle(getApplicationContext());
if (!name.equals("Default ringtone (notification_sound)")) {
saveSoundAs(RingtoneManager.TYPE_NOTIFICATION);
}
else {
CharSequence text = "The nortifacation is appointed!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(getApplicationContext(), text, duration);
toast.show();
}
but I want that there is a extra Case like that
Ringtone ringtone = RingtoneManager.getRingtone(this,Settings.System.DEFAULT_NOTIFICATION_URI);
String name = ringtone.getTitle(getApplicationContext());
if (!name.equals("Default ringtone (notification_sound)")) {
saveSoundAs(RingtoneManager.TYPE_NOTIFICATION);
}
else if(//notifaction is in the list of sounds){
//set this sound as default notifaction
}
else {
CharSequence text = "Der Klingelton ist schon eingestellt!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(getApplicationContext(), text, duration);
toast.show();
}
asked 2 mins ago
Android: Get if the nortifaction sound is in the sound list
Aucun commentaire:
Enregistrer un commentaire