Here is what fixed my problem if any one is interested in this.
I used:
private LayoutInflater inflater;
View tr = inflater.inflate(R.layout.table_row_chronology, null);
Instead of:
LayoutInflater inflater=(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Below is code :
private LayoutInflater inflater;
View tr = inflater.inflate(R.layout.table_row_chronology, null);
TableLayout tableChronology = (TableLayout) findViewById(R.id.mainTable);
tableChronology.addView(tr);