您好我正在开发一个Android短信应用程序,其中我试图包含settings.xml,首选项包含两个CheckBoxPreference和一个类似于链接的ListPreference
https://androidresearch.wordpress.com/2012/03/09/creating-a-preference-activity-in-android/
我希望ListPreference显示手机的默认铃声。如何通过listprefernce调用活动
public class Preference extends PreferenceActivity implements OnPreferenceClickListener
{
private ListPreference mListPreference;
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference);
mListPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener()
{
public boolean onPreferenceChange(android.preference.Preference preference, Object newValue)
{
//how to call an activity in this place
return true;
}
});
}
}
答案 0 :(得分:0)
我认为,你真正想要的是RingtonePreference
:
<RingtonePreference android:key="ringtone" android:ringtoneType="notification"/>
https://developer.android.com/reference/android/preference/RingtonePreference.html