当前位置: 首页>>代码示例>>Java>>正文


Java RingtonePreference.setOnPreferenceChangeListener方法代码示例

本文整理汇总了Java中android.preference.RingtonePreference.setOnPreferenceChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java RingtonePreference.setOnPreferenceChangeListener方法的具体用法?Java RingtonePreference.setOnPreferenceChangeListener怎么用?Java RingtonePreference.setOnPreferenceChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.preference.RingtonePreference的用法示例。


在下文中一共展示了RingtonePreference.setOnPreferenceChangeListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.preference.RingtonePreference; //导入方法依赖的package包/类
@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.settings);

    mChatRingtoneKey = getString(R.string.pref_chat_ringtone);
    mChatRingtonePreference = (RingtonePreference) findPreference(mChatRingtoneKey);
   // mLocationCityChangePreference = (ListPreference) findPreference(getActivity().getResources().getString(R.string.pref_location_settings));
    //mLocationCityChangePreference.setEntries();
    mChatRingtonePreference.setOnPreferenceChangeListener(this);
    //mLocationCityChangePreference.setOnPreferenceChangeListener(this);
    updateRingtonePreferenceSummary(mChatRingtonePreference, SharedPreferenceHelper
            .getString(R.string.pref_chat_ringtone));

    //updateLocationPreference(mLocationCityChangePreference,SharedPreferenceHelper.getString(R.string.pref_location_settings));

    mOtherRingtoneKey = getString(R.string.pref_other_ringtone);
    mOtherRingtonePreference = (RingtonePreference) findPreference(mOtherRingtoneKey);
    mOtherRingtonePreference.setOnPreferenceChangeListener(this);
    updateRingtonePreferenceSummary(mOtherRingtonePreference, SharedPreferenceHelper
            .getString(R.string.pref_other_ringtone));


}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:25,代码来源:SettingsFragment.java

示例2: initializeForPrayerTime

import android.preference.RingtonePreference; //导入方法依赖的package包/类
private void initializeForPrayerTime(final PrayerTimeType prayerTimeType) {
    String soundKey = Pref.Reminders.SOUND_BASE + prayerTimeType.name;

    RingtonePreference sound = (RingtonePreference) findPreference(soundKey);
    sound.setOnPreferenceChangeListener((preference, newValue) -> {
        updateSoundSummary(preference, (String) newValue);

        return true;
    });

    String currentSound = Pref.Reminders.sound(getActivity(), prayerTimeType);
    updateSoundSummary(sound, currentSound);

    String timeToRemindKey = Pref.Reminders.TIME_TO_REMIND_BASE + prayerTimeType.name;

    ListPreference timeToRemind = (ListPreference) findPreference(timeToRemindKey);
    timeToRemind.setOnPreferenceChangeListener((preference, newValue) -> {
        preference.setSummary(getString(R.string.preferences_reminders_timeToRemindSummary, Integer.parseInt((String) newValue)));

        return true;
    });

    int currentTimeToRemind = Pref.Reminders.timeToRemind(getActivity(), prayerTimeType);
    timeToRemind.setSummary(getString(R.string.preferences_reminders_timeToRemindSummary, currentTimeToRemind));
}
 
开发者ID:mehmetakiftutuncu,项目名称:Muezzin,代码行数:26,代码来源:ReminderPreferencesFragment.java

示例3: onCreate

import android.preference.RingtonePreference; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    getPreferenceManager().setSharedPreferencesMode(Context.MODE_WORLD_READABLE);
    addPreferencesFromResource(R.xml.settings);
    
    RingtonePreference p = (RingtonePreference)findPreference("pref_key_custom_ringtone");
    p.setOnPreferenceChangeListener(this);
    
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mActivity);
    updateRingtoneSummary(p, prefs.getString(p.getKey(), null));
}
 
开发者ID:eldarerathis,项目名称:Wireless-Charging-Xposed,代码行数:15,代码来源:Settings.java

示例4: onCreate

import android.preference.RingtonePreference; //导入方法依赖的package包/类
@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.settings);

    mChatRingtoneKey = getString(R.string.pref_chat_ringtone);
    mChatRingtonePreference = (RingtonePreference) findPreference(mChatRingtoneKey);
    mChatRingtonePreference.setOnPreferenceChangeListener(this);
    updateRingtonePreferenceSummary(SharedPreferenceHelper
                                            .getString(R.string.pref_chat_ringtone));
}
 
开发者ID:barterli,项目名称:barterli_android,代码行数:12,代码来源:SettingsFragment.java


注:本文中的android.preference.RingtonePreference.setOnPreferenceChangeListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。