Prompt please where it is possible to read about creating a custom layout listpreference ( background and layout top panel, panel button ). Met - examples only for custom ro
in your preference.xml file you can refer to your custom ListPreference by the full name of the class i.e. com.example.MyPreference
Then your class MyPreference hould be something like this:
import android.preference.ListPreference;
public class MyPreference extends ListPreference {
Context context;
public MyPreference(Context context, AttributeSet attrs) {
this.context = context;
setDialogLayoutResource(R.layout.yourLayout); //inherited from DialogPreference
setEntries(new CharSequence[] {"one", "two"});
setEntryValues(new CharSequence[] {"item1", "item2"});
}
protected void onDialogClosed(boolean positiveResult) {
Toast.makeText(context, "item_selected",
Toast.LENGTH_SHORT).show();
}
}