diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java index e538a15c1..8e8902807 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java @@ -88,6 +88,19 @@ public class GameListAdapter implements ExpandableListAdapter { return success; } + public boolean removeGroup( long groupid ) + { + long[] newArray = new long[m_positions.length - 1]; + int destIndex = 0; + for ( long id : m_positions ) { + if ( id != groupid ) { + newArray[destIndex++] = id; + } + } + m_positions = newArray; + return true; + } + public void expandGroups( ExpandableListView view ) { HashMap info = gameInfo(); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index 60b08e681..41b35f383 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -554,7 +554,9 @@ public class GamesList extends XWExpandableListActivity case DELETE_GROUP_ACTION: GameUtils.deleteGroup( this, m_groupid ); - onContentChanged(); + if ( m_adapter.removeGroup( m_groupid ) ) { + onContentChanged(); + } break; default: Assert.fail();