3
我想在非首選項活動中顯示ListPreference對話框。如何創建ListPreference對話框以顯示在非首選項活動中
這裏是我創建的對話框代碼
// this is my current activity
ListPreference listPreference = new ListPreference(this);
listPreference.setDialogIcon(R.drawable.auto_download);
listPreference.setTitle(R.string.autoDownloadTitle);
listPreference.setEntries(R.array.autoDownloadEntries);
listPreference.setEntryValues(R.array.autoDownloadValues);
listPreference.setNegativeButtonText(R.string.cancel);
Dialog dialog = listPreference.getDialog();
我的問題是,對話是空永諾... 我錯過了什麼?