Have a look at this code:
ArrayList<Object> row = data.get(position);
TextView idText = new TextView(this);
idText.setText(row.get(0).toString());
tableRow.addView(idText);
TextView storeText = new TextView(this);
idText.setText(row.get(1).toString());
tableRow.addView(storeText);
TextView maggiText = new TextView(this);
idText.setText(row.get(2).toString());
tableRow.addView(maggiText);
I have to manually create a TextView
, set it to some string and then pass it. Is there a way by which I can directly pass the string to row that can be put in a for
loop?
I am looking for this approach for scalability issues.