diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java index 2d03c1de3..d8373ccb9 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java @@ -375,6 +375,11 @@ public class GameUtils { return DBUtils.saveGame( context, lock, bytes, setCreate ); } + public static GameLock saveNewGame( Context context, byte[] bytes ) + { + return saveNewGame( context, bytes, DBUtils.GROUPID_UNSPEC ); + } + public static GameLock saveNewGame( Context context, byte[] bytes, long groupID ) { @@ -383,7 +388,9 @@ public class GameUtils { public static long saveNew( Context context, CurGameInfo gi, long groupID ) { - Assert.assertTrue( DBUtils.GROUPID_UNSPEC != groupID ); + if ( DBUtils.GROUPID_UNSPEC == groupID ) { + groupID = XWPrefs.getDefaultNewGameGroup( context ); + } long rowid = DBUtils.ROWID_NOTFOUND; byte[] bytes = XwJNI.gi_to_stream( gi ); 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 781b46b35..de8875885 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -821,8 +821,7 @@ public class GamesList extends XWExpandableListActivity byte[] stream = GameUtils.savedGame( GamesList.this, selRowIDs[0] ); GameLock lock = - GameUtils.saveNewGame( GamesList.this, stream, - getSaveGroup() ); + GameUtils.saveNewGame( GamesList.this, stream ); DBUtils.saveSummary( GamesList.this, lock, smry ); m_selGames.add( lock.getRowid() ); lock.unlock(); @@ -1055,9 +1054,6 @@ public class GamesList extends XWExpandableListActivity private void startNewGameActivity( long groupID ) { - if ( DBUtils.GROUPID_UNSPEC == groupID ) { - groupID = getSaveGroup(); - } NewGameActivity.startActivity( this, groupID ); } @@ -1337,15 +1333,6 @@ public class GamesList extends XWExpandableListActivity } } - private long getSaveGroup() - { - long groupID = XWPrefs.getDefaultNewGameGroup( this ); - if ( DBUtils.GROUPID_UNSPEC == groupID ) { - groupID = m_adapter.getGroupIDFor( 0 ); - } - return groupID; - } - public static void onGameDictDownload( Context context, Intent intent ) { intent.setClass( context, GamesList.class ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameActivity.java index 89d445080..c45bd58bb 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameActivity.java @@ -79,7 +79,6 @@ public class NewGameActivity extends XWActivity { getBundledData( savedInstanceState ); m_groupID = getIntent().getLongExtra( GROUPID_EXTRA, -1 ); - Assert.assertTrue( -1 != m_groupID ); setContentView( R.layout.new_game );