I want to display a ListPreference Dialog in a non Preference Activity.
Here's my the code that creates the Dialog
// 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();
My problem is that dialog is allways null... What did I miss ?