mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
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:
parent
1035c94c3f
commit
5e03e0cc75
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue