fix another class cast exception

But this is by inspection and, involving a dialog that is no longer
posted, could probably never occur.
This commit is contained in:
Eric House 2017-03-07 07:35:16 -08:00
parent 9211d6b765
commit 0980bcfbe5

View file

@ -181,18 +181,27 @@ public class BoardDelegate extends DelegateBase
Dialog dialog; Dialog dialog;
switch ( dlgID ) { switch ( dlgID ) {
case DLG_RETRY:
case DLG_OKONLY: { case DLG_OKONLY: {
int title = (Integer)params[0]; int title = (Integer)params[0];
String msg = (String)params[1]; String msg = (String)params[1];
dialog = ab ab.setTitle( title )
.setTitle( title )
.setMessage( msg ) .setMessage( msg )
.setPositiveButton( android.R.string.ok, null ) .setPositiveButton( android.R.string.ok, null );
.create(); if ( DlgID.DLG_RETRY == dlgID ) {
lstnr = new OnClickListener() {
@Override
public void onClick( DialogInterface dlg,
int whichButton ) {
handleViaThread( JNICmd.CMD_RESET );
}
};
ab.setNegativeButton( R.string.button_retry, lstnr );
}
dialog = ab.create();
} }
break; break;
case DLG_RETRY:
case GAME_OVER: case GAME_OVER:
case DLG_CONNSTAT: { case DLG_CONNSTAT: {
GameSummary summary = (GameSummary)params[0]; GameSummary summary = (GameSummary)params[0];
@ -201,15 +210,7 @@ public class BoardDelegate extends DelegateBase
ab.setTitle( title ) ab.setTitle( title )
.setMessage( msg ) .setMessage( msg )
.setPositiveButton( android.R.string.ok, null ); .setPositiveButton( android.R.string.ok, null );
if ( DlgID.DLG_RETRY == dlgID ) { if ( DlgID.GAME_OVER == dlgID
lstnr = new OnClickListener() {
public void onClick( DialogInterface dlg,
int whichButton ) {
handleViaThread( JNICmd.CMD_RESET );
}
};
ab.setNegativeButton( R.string.button_retry, lstnr );
} else if ( DlgID.GAME_OVER == dlgID
&& rematchSupported( m_activity, true, summary ) ) { && rematchSupported( m_activity, true, summary ) ) {
lstnr = new OnClickListener() { lstnr = new OnClickListener() {
public void onClick( DialogInterface dlg, public void onClick( DialogInterface dlg,