fix crash adding first game to newly installed app by counting games and groups the same way getView determines if they exist.

This commit is contained in:
Eric House 2014-04-09 05:52:36 -07:00
parent 1035c94c3f
commit 5e03e0cc75

View file

@ -67,8 +67,15 @@ public class GameListAdapter extends XWListAdapter
@Override
public int getCount()
{
return DBUtils.getGroups( m_context ).size()
+ DBUtils.countVisibleGames( m_context );
HashMap<Long,GameGroupInfo> groups = DBUtils.getGroups( m_context );
int count = groups.size();
for ( GameGroupInfo ggi : groups.values() ) {
if ( ggi.m_expanded ) {
count += ggi.m_count;
}
}
// DbgUtils.logf( "GameListAdapter.getCount() => %d", count );
return count;
}
@Override