ListPreferenceHey I'm using PreferenceActivity and added radio button to it using ListPreference. The problem is that listPreference uses it own dialog which has blue radio button (green on lollipop) and I need to change it to orange. I managed to get the dialog and change the headline and the divider color using the following:
listPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
AlertDialog dialog = (AlertDialog) listPreference.getDialog();
if (dialog != null) {
changeDialog(getApplicationContext(), dialog);
}
return true;
}});
public void changeDialog(Context context, final AlertDialog dialog) {
int titleViewId = dialog.getContext().getResources().getIdentifier("android:id/alertTitle", null, null);
TextView title = (TextView) dialog.findViewById(titleViewId);
title.setTextColor(context.getResources().getColor(R.color.orange));
}
So if the title id is "android:id/alertTitle" and the divder id is "android:id/titleDivider", what is the id for the radio button?