I would like to change the RadioButton
that appears on ListPreference
dialog for a check mark or something different, or none, is there a simple wa
if you want java code. try to following code.
public class SearchEngineListPreference extends ListPreference {
private Context mContext;
public SearchEngineListPreference(Context context) {
super(context);
mContext = context;
}
public SearchEngineListPreference(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
}
@SuppressWarnings("New API")
public SearchEngineListPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mContext = context;
}
@SuppressWarnings("New API")
public SearchEngineListPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
mContext = context;
}
@Override
protected void onClick() {
AlertDialog.Builder ab = new AlertDialog.Builder(mContext);
ab.setCancelable(true);
ab.setTitle(getTitle());
String value = getValue();
ab.setSingleChoiceItems(R.array.setting_entries_search_engine,
findIndexOfValue(value),
(dialog, index) -> {
CharSequence[] entryValues = getEntryValues();
if (callChangeListener(entryValues[index].toString())){
setValueIndex(index);
}
dialog.dismiss();
}).setNeutralButton(mContext.getString(R.string.dialog_button_custom),
(dialog, whichButton) -> {
dialog.dismiss();
showEditDialog();
}).setNegativeButton(mContext.getString(R.string.dialog_button_negative),
(dialog, whichButton) -> {
dialog.dismiss();
});
ab.show();
}
private void showEditDialog() {
.......
}