use of android.media.Ringtone in project Douya by DreaminginCodeZH.
the class RingtonePreference method getSummary.
@Override
public CharSequence getSummary() {
CharSequence summary = super.getSummary();
if (!TextUtils.isEmpty(summary)) {
Uri ringtoneUri = getRingtoneUri();
String ringtoneTitle = "";
if (ringtoneUri != null) {
Context context = getContext();
Ringtone ringtone = RingtoneManager.getRingtone(context, ringtoneUri);
if (ringtone != null) {
ringtoneTitle = ringtone.getTitle(context);
}
}
return String.format(summary.toString(), ringtoneTitle);
} else {
return summary;
}
}
use of android.media.Ringtone in project barcodescanner by dm77.
the class FullScannerFragment method handleResult.
@Override
public void handleResult(Result rawResult) {
try {
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getActivity().getApplicationContext(), notification);
r.play();
} catch (Exception e) {
}
showMessageDialog("Contents = " + rawResult.getText() + ", Format = " + rawResult.getBarcodeFormat().toString());
}
use of android.media.Ringtone in project barcodescanner by dm77.
the class FullScannerFragment method handleResult.
@Override
public void handleResult(Result rawResult) {
try {
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getActivity().getApplicationContext(), notification);
r.play();
} catch (Exception e) {
}
showMessageDialog("Contents = " + rawResult.getContents() + ", Format = " + rawResult.getBarcodeFormat().getName());
}
use of android.media.Ringtone in project barcodescanner by dm77.
the class FullScannerActivity method handleResult.
@Override
public void handleResult(Result rawResult) {
try {
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
r.play();
} catch (Exception e) {
}
showMessageDialog("Contents = " + rawResult.getContents() + ", Format = " + rawResult.getBarcodeFormat().getName());
}
use of android.media.Ringtone in project HoloEverywhere by Prototik.
the class _RingtonePickerDialog method run.
@Override
public void run() {
if (sampleRingtonePos == silentPos) {
ringtoneManager.stopPreviousRingtone();
return;
}
if (defaultRingtone != null && defaultRingtone.isPlaying()) {
defaultRingtone.stop();
defaultRingtone = null;
}
Ringtone ringtone;
if (sampleRingtonePos == defaultRingtonePos) {
if (defaultRingtone == null) {
defaultRingtone = RingtoneManager.getRingtone(context, uriForDefaultItem);
}
ringtone = defaultRingtone;
ringtoneManager.stopPreviousRingtone();
} else {
ringtone = ringtoneManager.getRingtone(getRingtoneManagerPosition(sampleRingtonePos));
}
if (ringtone != null) {
ringtone.play();
}
}
Aggregations