Code example for TableRow.LayoutParams

0
	} 
	 
	private void addRow(int position, String name, int score, String Date) {
		 
		TableRow row = new TableRow(this);
		LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
		row.setLayoutParams(params);
		 
		row.addView(createTextView(params, position + ""));
		row.addView(createTextView(params, name));
		row.addView(createTextView(params, score + ""));
		row.addView(createTextView(params, Date));
		 
		highscoreTable.addView(row, new TableLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));		
	} 
	private TextView createTextView(LayoutParams params, String text) {
		TextView view = new TextView(this);
		view.setLayoutParams(params);
		view.setText(text);
		return view;
Contextual code suggestions in your IDE  Get Codota for Java