Code example for TableLayout

Methods: removeAllViewsrequestLayout

0
    	populateHistory(); 
    } 
 
     
    void populateHistory(){ 
        history.removeAllViews();
        String[][] t=MainActivity.fm.getHistory();
         
         
        for(int i=0;i<t.length;i++){
        	TableRow tr=new TableRow(getActivity());
        	//tr.setLayoutParams(lp); 
        	TextView tuition=new TextView(getActivity());
        	tuition.setText(t[i][0]);
        	tuition.setTextSize(TypedValue.COMPLEX_UNIT_DIP,20);
        	TextView paid=new TextView(getActivity());
        	paid.setText(t[i][1]);
        	TextView month=new TextView(getActivity());
        	month.setText(t[i][2]);
        	tr.addView(tuition);
        	tr.addView(paid);
        	tr.addView(month);
        	history.addView(tr);
        } 
         
        history.requestLayout();
         
    } 
public void refreshHistory(View view){
    	populateHistory(); 
    }