0

I'm new android, I have a Table like this:

enter image description here

I want to set dynamic data columns 1 + 2 from DataBase, use Edit Text for Column 3 and the data in it from the user, per data entered from column 3 would be classified as appropriate in column 4. I should use Table Layout, Grid View or List View and how to get data after changed edittext. Any one have an idea resolve? Thank a lot!

ChrisB
  • 2,497
  • 2
  • 24
  • 43
Tài Bùi
  • 3
  • 6

2 Answers2

0

ListView as the name suggests, you will have just a list with elements so it has to do nothing here. The GridView will split some elements in rows but it is not a table. If I understood your question you want to display the table. For this you should use the TableLayout. Here you can see more info

https://developer.android.com/guide/topics/ui/layout/grid.html

For dynamic tables you can look to this post:

Adding Table rows Dynamically in Android

Community
  • 1
  • 1
0

Tableview definatly after you do the layout , in your code you can do

TableLayout tblLayout = (TableLayout)findViewById(R.id.tableLayout);
TableRow row = (TableRow)tblLayout.getChildAt(YYY); // Here get row id depending on number of row
Edittext edittext= (Edittext)row.getChildAt(XXX); 
String text = edittext.gettext().toString();

to access data from the table here is an easy example of a table layout https://www.mkyong.com/android/android-tablelayout-example/ enjoy

yanivtwin
  • 617
  • 8
  • 32