Print out ArrayList content in Android TableLayout

后端 未结 3 813
一生所求
一生所求 2020-12-30 18:20

I have this ArrayList:

 ArrayList debtList = datasource.debtList;
 ArrayList feeList = datasource.feeList;

How

3条回答
  •  星月不相逢
    2020-12-30 18:51

    Ok, you have two arraylists debtList and feeList, I assume both the arraylist contains equal number of elements, now iterate through this list, Create Table Row add two textViews to table row, and add tablerow to the tableLayout, so you can do following:

    ArrayList debtList = datasource.debtList;
    ArrayList feeList = datasource.feeList;
    TableLayout table = (TableLayout) findViewById(R.id.myTableLayout);
    for(int i=0;i

提交回复
热议问题