Tirolel Tirolel - 7 days ago 6x
Android Question

Limit tablelayout rows, android

I was wondering if it's possible to add a limit such as maximum of row/s to the tablelayout?

So I can, let's say, insert or show only last 100 instead of entire view. The data is dynamically populated and inserted.


int _tableCount = _tableLayout.getChildCount();
if(_tableCount > 100)


You can check count of rows by getChildCount() method, and add rows only if count is less than 100.