2014-09-25 35 views

回答

1

试试这个:

listView.getAdapter().getCount(): 
0

您可以使用getCount()方法:

返回 由与此相关的适配器视图适配器拥有的项目数。 (这是数据项,这可能比可见视图的数量还要多。)

int rows = myistView.getCount(); 
+0

每当使用上面的代码时得到0 – 2014-09-25 11:51:52