Code example for AbsListView.LayoutParams

0
 
	@Override 
	public View getView(int position, View convertView, ViewGroup parent)
	{ 
		TextView colorview = new TextView(getContext());
		colorview.setLayoutParams(new LayoutParams(50, 50));
		colorview.setBackgroundColor(colorrefs[position]);
		colorview.setTag(colorrefs[position]);
		 
		return colorview;
	} 
 
	@Override 
	public int getCount() 
	{ 
		// TODO Auto-generated method stub 
		return colorrefs.length;
	} 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java