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:
Eric House 2017-04-08 13:15:24 -07:00
parent 4668beee78
commit 832b3adfd2
4 changed files with 15 additions and 14 deletions

View file

@ -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 )

View file

@ -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() );
}
}
}

View file

@ -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 )

View file

@ -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 );