The only way to change the color of the header separator is to use the Resources.getIdentifier in combination with Window.findViewById . The flag can be easily changed by calling AlertDialog.Builder.setSingleChoiceItems(ListAdapter, int, OnClickListener) .
Here is an example:
Single select item layout : I generated your_radio_button using Android Holo Colors.
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:checkMark="@drawable/your_radio_button" android:ellipsize="marquee" android:gravity="center_vertical" android:minHeight="?android:attr/listPreferredItemHeightSmall" android:paddingEnd="16dip" android:paddingStart="16dip" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="?android:attr/textColorAlertDialogListItem" />
Implementation
final ListAdapter adapter = new ArrayAdapter<String>(this, R.layout.select_dialog_singlechoice, android.R.id.text1, new String[] { "Option 1", "Option 2" }); final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setCustomTitle(getLayoutInflater().inflate(R.layout.custom_alert_title, null)); builder.setSingleChoiceItems(adapter, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) {
results

source share