Helpful Information
Home
Categories
Contact us
Category: Android Development
NotePad Tutorial Question
I can't seem to figure out how this
mRowId = (savedInstanceState == null) ? null :
(Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID);
if (mRowId == null) {
Bundle extras = getIntent().getExtras();
mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)
: null;
}
is different from this
if(savedInstanceState == null)
{
mRowId =(Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID);
}
else if(extras != null)
{
Bundle extras = getIntent().getExtras();
mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)
: null;
}
I also don't see the benefit of using inline conditions(except it's a little cleaner/shorter)
privacy (GDPR)