
November 14th, 2011, 01:50 PM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 29
Time spent in forums: 6 h 40 m 18 sec
Reputation Power: 0
|
|
NotePad Tutorial Question
I can't seem to figure out how this
Code:
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
Code:
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)
|