mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
cleanup; fail safely
Remove or fix some logging; in a case that rarely shows a NPE check first but only assert on debug builds. Fail silently on release builds.
This commit is contained in:
parent
4668beee78
commit
832b3adfd2
4 changed files with 15 additions and 14 deletions
|
@ -652,9 +652,11 @@ public class BoardDelegate extends DelegateBase
|
|||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState( Bundle outState )
|
||||
{
|
||||
outState.putSerializable( SAVE_MYSIS, m_mySIS );
|
||||
super.onSaveInstanceState( outState );
|
||||
}
|
||||
|
||||
private void getBundledData( Bundle bundle )
|
||||
|
|
|
@ -458,10 +458,6 @@ public class MainActivity extends XWActivity
|
|||
safeAddFragment( fragment, parentName );
|
||||
}
|
||||
} );
|
||||
if ( BuildConfig.DEBUG ) {
|
||||
DbgUtils.showf( this, "Putting off fragment construction; %d waiting",
|
||||
m_runWhenSafe.size() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,9 +53,11 @@ public class XWDialogFragment extends DialogFragment {
|
|||
|
||||
if ( null != m_buttonMap ) {
|
||||
AlertDialog dialog = (AlertDialog)getDialog();
|
||||
Assert.assertTrue( null != dialog || !BuildConfig.DEBUG );
|
||||
if ( null != dialog) {
|
||||
for ( final int but : m_buttonMap.keySet() ) {
|
||||
// final int fbut = but;
|
||||
dialog.getButton( but )
|
||||
dialog.getButton( but ) // NPE!!!
|
||||
.setOnClickListener( new OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View view ) {
|
||||
|
@ -65,6 +67,7 @@ public class XWDialogFragment extends DialogFragment {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel( DialogInterface dialog )
|
||||
|
|
|
@ -84,7 +84,7 @@ abstract class XWFragment extends Fragment implements Delegator {
|
|||
@Override
|
||||
public void onSaveInstanceState( Bundle outState )
|
||||
{
|
||||
Log.d( TAG, "%s.onCreate() called", getClass().getSimpleName() );
|
||||
Log.d( TAG, "%s.onSaveInstanceState() called", getClass().getSimpleName() );
|
||||
Assert.assertNotNull( m_parentName );
|
||||
outState.putString( PARENT_NAME, m_parentName );
|
||||
m_dlgt.onSaveInstanceState( outState );
|
||||
|
|
Loading…
Reference in a new issue