I'm trying to make a dotted line. I'm using this right now for a solid line: LinearLayout divider = new LinearLayout( this ); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, 2 ); divider.setLayoutParams( params ); divider.setBackgroundColor( getResources().getColor( R.color.grey ) ); I need something like this, but dotted instead of solid. I