Fix Notepadv3Solution orientation changes during NoteEdit

The current NoteEdit.java in Notepadv3Solution crashes on NPE when the
screen orientation changes.  This happens because a null Long is
auto-unboxed to a long when used as an input to
Bundle.putLong(String, long).  The easiest solution is to use
Bundle.putSerializable() instead.

In addition duplicate notepad entries could result because mRowId was not
necessarily defined when onSaveInstanceState(Bundle) was called.  The
solution to that is to call saveState() in that method.

Fixes these buganizer bugs:

Change-Id: Ice325f3b089867e4716deb48aefe8ec03f30ad55
http://b/issue?id=2266994
http://b/issue?id=2266962
diff --git a/tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java b/tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java
index 710ea33..f5eb6c4 100755
--- a/tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java
+++ b/tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java
@@ -43,8 +43,8 @@
       
         Button confirmButton = (Button) findViewById(R.id.confirm);
        
-        mRowId = savedInstanceState != null ? savedInstanceState.getLong(NotesDbAdapter.KEY_ROWID) 
-                							: null;
+        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) 
@@ -77,7 +77,8 @@
     @Override
     protected void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);
-        outState.putLong(NotesDbAdapter.KEY_ROWID, mRowId);
+        saveState();
+        outState.putSerializable(NotesDbAdapter.KEY_ROWID, mRowId);
     }
     
     @Override