當前位置: 首頁>>代碼示例>>Java>>正文


Java RingtoneManager.ACTION_RINGTONE_PICKER屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:ric96,項目名稱:lineagex86,代碼行數:18,代碼來源:OtherSoundSettings.java

示例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);
}
 
開發者ID:mecid,項目名稱:robird-reborn,代碼行數:17,代碼來源:SettingsFragment.java

示例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);
    }
}
 
開發者ID:kaliturin,項目名稱:BlackList,代碼行數:15,代碼來源:SettingsFragment.java

示例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);
}
 
開發者ID:MCMrARM,項目名稱:revolution-irc,代碼行數:14,代碼來源:RingtoneSetting.java

示例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);
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:15,代碼來源:LedSettingsFragment.java

示例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);
}
 
開發者ID:jpmeijers,項目名稱:ttnmapper_android_v2,代碼行數:7,代碼來源:SettingsActivity.java

示例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;
	}
}
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:47,代碼來源:AntiTheftSetupAty.java

示例8: onClick

@Override
protected void onClick() {
    Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
    onPrepareRingtonePickerIntent(intent);
    mParent.startActivityForResult(intent, RINGTONE_PICKER_REQUEST);
}
 
開發者ID:davideas,項目名稱:AndroidBlueprints,代碼行數:6,代碼來源:RingtonePreference.java


注:本文中的android.media.RingtoneManager.ACTION_RINGTONE_PICKER屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。