Set rowSpan or colSpan of a child of a GridLayout programmatically?

GridLayout gridLayout = (GridLayout)findViewById(R.id.tableGrid); gridLayout.removeAllViews(); int total = 12; int column = 5; int row = total / column; gridLayout.setColumnCount(column); gridLayout.setRowCount(row + 1); for(int i =0, c = 0, r = 0; i < total; i++, c++) { if(c == column) { c = 0; r++; } ImageView oImageView = new ImageView(this); oImageView.setImageResource(R.drawable.ic_launcher); GridLayout.LayoutParams param … Read more