Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get total RowCount for TableLayout in Android

I have a TableLayout in which I add the Table Column titles in my Layout XML file, and add other rows dynamically through the code(based on a condition). So there are cases when no rows are added to the table. I need to check if no rows exist for the table. How should I go about it?

like image 308
jetty Avatar asked Dec 10 '22 21:12

jetty


1 Answers

Through this code you can get the total rowCount for TableLayout

TableLayoutName.getChildCount();

This method return the total number of rows in integer value.

like image 128
HassanUsman Avatar answered Dec 13 '22 10:12

HassanUsman