1) Create a new xml where checkMark is the style and animation of the checkmark, and checkMarkTint is the color of the checkmark
<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:ellipsize="marquee" android:gravity="center_vertical" android:paddingEnd="16dip" android:layout_marginTop="10dp" android:paddingStart="16dip" android:textSize="14sp" android:checkMark=""="?android:attr/listChoiceIndicatorSingle" android:checkMarkTint="@color/your_checkmark_color" android:textColor="@color/your_text_color" />
2) Then create an adapter above your alerDialog.SetSingleChoiceItems
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getApplicationContext(),R.layout.your_custom_layout, charSequenceList);
3) Add an adapter
alerDialog.setSingleChoiceItems(adapter, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) {
Ashky source share