您好我正在开发一个 android SMS 应用程序,其中我试图包含 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;
}
});
}
}