mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
fix crash when no radio's been chosen
This commit is contained in:
parent
97962fceed
commit
63262ba9b3
1 changed files with 22 additions and 20 deletions
|
@ -128,27 +128,29 @@ public class NewWithKnowns extends LinearLayout
|
|||
|
||||
void onButtonPressed( ButtonCallbacks procs )
|
||||
{
|
||||
Context context = getContext();
|
||||
String gameName = gameName();
|
||||
switch ( mCurRadio ) {
|
||||
case R.id.radio_known:
|
||||
DBUtils.setStringFor( context, KP_NAME_KEY, mCurKnown );
|
||||
procs.onUseKnown( mCurKnown, gameName );
|
||||
break;
|
||||
case R.id.radio_unknown:
|
||||
case R.id.radio_default:
|
||||
procs.onStartGame( gameName, mStandalone, false );
|
||||
break;
|
||||
case R.id.radio_configure:
|
||||
procs.onStartGame( gameName, mStandalone, true );
|
||||
break;
|
||||
default:
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
if ( 0 != mCurRadio ) {
|
||||
Context context = getContext();
|
||||
String gameName = gameName();
|
||||
switch ( mCurRadio ) {
|
||||
case R.id.radio_known:
|
||||
DBUtils.setStringFor( context, KP_NAME_KEY, mCurKnown );
|
||||
procs.onUseKnown( mCurKnown, gameName );
|
||||
break;
|
||||
case R.id.radio_unknown:
|
||||
case R.id.radio_default:
|
||||
procs.onStartGame( gameName, mStandalone, false );
|
||||
break;
|
||||
case R.id.radio_configure:
|
||||
procs.onStartGame( gameName, mStandalone, true );
|
||||
break;
|
||||
default:
|
||||
Assert.failDbg(); // fired
|
||||
break;
|
||||
}
|
||||
|
||||
String key = mStandalone ? KP_PREVSOLO_KEY : KP_PREVNET_KEY;
|
||||
DBUtils.setIntFor( context, key, mCurRadio );
|
||||
String key = mStandalone ? KP_PREVSOLO_KEY : KP_PREVNET_KEY;
|
||||
DBUtils.setIntFor( context, key, mCurRadio );
|
||||
}
|
||||
}
|
||||
|
||||
private String gameName()
|
||||
|
|
Loading…
Reference in a new issue