本文整理汇总了Java中android.media.RingtoneManager.ACTION_RINGTONE_PICKER属性的典型用法代码示例。如果您正苦于以下问题:Java RingtoneManager.ACTION_RINGTONE_PICKER属性的具体用法?Java RingtoneManager.ACTION_RINGTONE_PICKER怎么用?Java RingtoneManager.ACTION_RINGTONE_PICKER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.media.RingtoneManager
的用法示例。
在下文中一共展示了RingtoneManager.ACTION_RINGTONE_PICKER属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: launchNotificationSoundPicker
private void launchNotificationSoundPicker(int code, String currentPowerRingtonePath) {
final Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE,
getString(R.string.power_notifications_ringtone_title));
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,
RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI,
System.DEFAULT_NOTIFICATION_URI);
if (currentPowerRingtonePath != null &&
!currentPowerRingtonePath.equals(POWER_NOTIFICATIONS_SILENT_URI)) {
Uri uri = Uri.parse(currentPowerRingtonePath);
if (uri != null) {
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, uri);
}
}
startActivityForResult(intent, code);
}
示例2: pickNotificationRingtone
private void pickNotificationRingtone() {
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI, Settings.System.DEFAULT_NOTIFICATION_URI);
String existingValue = mPrefsModel.notificationSound();
if (TextUtils.isEmpty(existingValue)) {
// Select "Silent"
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null);
} else {
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, Uri.parse(existingValue));
}
startActivityForResult(intent, REQUEST_CODE_RINGTONE);
}
示例3: onClick
@Override
public void onClick(View view) {
if (isAdded()) {
if (adapter.isRowChecked(view)) {
// open ringtone picker dialog
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, getString(R.string.Ringtone_picker));
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, getRingtoneUri(requestCode));
startActivityForResult(intent, requestCode);
}
} else {
adapter.setRowChecked(view, false);
}
}
示例4: onClick
@Override
public void onClick(View v) {
RingtoneSetting entry = getEntry();
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, entry.mValue);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI,
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, entry.mName);
intent.putExtra("android.intent.extra.ringtone.AUDIO_ATTRIBUTES_FLAGS", 0x1 << 6); // Perhaps a bit of a hack, but imo needed
mAdapter.startActivityForResult(intent, entry.mRequestCode);
}
示例5: onPreferenceTreeClick
@Override
public boolean onPreferenceTreeClick(PreferenceScreen prefScreen, Preference pref) {
if (pref == mNotifSoundPref) {
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, mSoundUri);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI,
Settings.System.DEFAULT_NOTIFICATION_URI);
startActivityForResult(intent, REQ_PICK_SOUND);
return true;
}
return super.onPreferenceTreeClick(prefScreen, pref);
}
示例6: onChooseSound
public void onChooseSound(View v) {
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Tone");
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null);
this.startActivityForResult(intent, 5);
}
示例7: onClick
@SuppressWarnings("deprecation")
@Override
public void onClick(View v) {
boolean status = false;
switch(v.getId()){
case R.id.antiTheftStatus:
status = MyUtils.getToogleImageStatus(ivShowAntiTheftStatus)==true?false:true;
setSP.setAntiTheftShowStatus(status);
MyUtils.setToogleImageStatus(ivShowAntiTheftStatus, status);
break;
case R.id.ring:
status = MyUtils.getToogleImageStatus(ivRing)==true?false:true;
setSP.setAntiTheftRing(status);
MyUtils.setToogleImageStatus(ivRing, status);
break;
case R.id.vibrate:
status = MyUtils.getToogleImageStatus(ivVibrate)==true?false:true;
setSP.setAntiTheftVibrate(status);
MyUtils.setToogleImageStatus(ivVibrate, status);
break;
case R.id.delay:
listType = 0;
FavoriteCharacterDialogFragment.show(this, "报警延时", strDelayTimes);
break;
case R.id.ringtone:
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "设置报警铃音");
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_RINGTONE);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
startActivityForResult(intent, REQUEST_SELECT_ALARM_RINGTONE);
break;
case R.id.enhancedMode:
status = MyUtils.getToogleImageStatus(ivEnhancedMode)==true?false:true;
setSP.setAntiTheftOpenBTEnhancedMode(status);
MyUtils.setToogleImageStatus(ivEnhancedMode, status);
break;
case R.id.bt:
status = MyUtils.getToogleImageStatus(ivBTClosed)==true?false:true;
setSP.setAntiTheftBTClosedAlarm(status);
MyUtils.setToogleImageStatus(ivBTClosed, status);
break;
case R.id.sensivity:
listType = 1;
FavoriteCharacterDialogFragment.show(this, "静置报警灵敏度", strRestSensitivitys);
break;
}
}
示例8: onClick
@Override
protected void onClick() {
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
onPrepareRingtonePickerIntent(intent);
mParent.startActivityForResult(intent, RINGTONE_PICKER_REQUEST);
}