I have one problem to create my application in Android. Here in my application I bind the ArrayList Data into TableLayout. When I run the application, only the last column of data is bound. I have required all columns to be bound. Please help me...
I have provided my code:
View Task.xml:
<TableLayout
android:id="@+id/score_table1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow></TableRow>
</TableLayout>
View task.java:
TableLayout table = (TableLayout) findViewById(R.id.score_table1);
for(int i=0;i<object.size();i++)
{
TableRow row=new TableRow(ViewTask.this);
@SuppressWarnings("unchecked")
ArrayList<String> data1 = (ArrayList<String>) object.get(i);
TextView taskdate = new TextView(ViewTask.this);
taskdate.setTextSize(10);
taskdate.setText(data1.get(0).toString());
row.addView(taskdate);
TextView title = new TextView(ViewTask.this);
taskdate.setText(data1.get(1).toString());
row.addView(title);
taskdate.setTextSize(10);
TextView taskhour = new TextView(ViewTask.this);
taskdate.setText(data1.get(2).toString());
taskhour.setTextSize(10);
row.addView(taskhour);
TextView description = new TextView(ViewTask.this);
taskdate.setText(data1.get(3).toString());
row.addView(description);
description.setTextSize(10);
table.addView(row);
}