mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
fix crash when no radio's been chosen
This commit is contained in:
parent
97962fceed
commit
60d6cf444a
1 changed files with 27 additions and 22 deletions
|
@ -98,8 +98,11 @@ public class NewWithKnowns extends LinearLayout
|
|||
toHide = new int[]{ R.id.radio_default, R.id.choose_expl_default,
|
||||
};
|
||||
} else {
|
||||
toHide = new int[]{ R.id.radio_known, R.id.names, R.id.expl_known,
|
||||
R.id.radio_unknown, R.id.choose_expl_new,
|
||||
toHide = new int[]{ R.id.radio_unknown,
|
||||
R.id.choose_expl_new,
|
||||
R.id.radio_known,
|
||||
R.id.names,
|
||||
R.id.expl_known,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -128,27 +131,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