-4

I reaaly need your help. I have an AlertDialog that contains an arraylist. I would like to customize line separators of my arraylist.

This is my code.

AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 
List<Tour> listTour = service.getOpenedTours(); 
listProd = new ArrayList<Producer>();
 builder.setTitle("Selectionner un producteur"); 
float[] res = new float[3];
 List<Producer> producers = new ArrayList<Producer>(); 
String prods = listProd.toString(); 
CharSequence[] cs = prods.split(", "); 
builder.setItems(cs, new DialogInterface.OnClickListener() 
{ 
public void onClick(DialogInterface dialog, int which)
 {

 });
 builder.create().show(); 
}
 }
Däñish Shärmà
  • 2,891
  • 2
  • 25
  • 43

1 Answers1

0

If you are using arraylist to ListView then you need to set divider color of ListView as below:

Edit

AlertDialog alertDialogObject = dialogBuilder.create();
ListView listView=alertDialogObject.getListView();  
listView.setDivider(new ColorDrawable(Color.RED)); // set color
alertDialogObject.show();
Android Geek
  • 8,956
  • 2
  • 21
  • 35