Tirolel Tirolel - 11 months ago 98
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)

Answer Source

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