[Reported against r17 of WikiNotes running in beta 0.9 emulator.]
Problem: Back key crashes WikiNotes if previous note was deleted.
To reproduce: Create some notes, delete one, go to the notes list, and
start hitting the Back key. When you get back to the deleted note,
WikiNotes crashes (and then restarts).
Another problem: WikiNotes creates too much useless history? As one
continues to use WikiNotes, the activity history continues to accumulate,
including references to notes that have subsequently been deleted. The Back
key becomes useless because so many references have been maintained.
Even after WikiNotes restarts, the old activity seems to be retained. This
makes me wonder if the activity-based mechanism that WikiNotes exemplifies
is really so great in practice. Notice how many windows die when WikiNotes
crashes below... A much shorter, hierarchical history would be more useful,
and would retain no more than a few windows in the worst case.
This trace shows the crash due to the deleted note:
E/AndroidRuntime( 241):
Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 241): java.lang.RuntimeException:
Unable to resume activity
{com.google.android.wikinotes/com.google.android.wikinotes.WikiNotes}:
android.database.CursorIndexOutOfBoundsException:
Index 0 requested, with a size of 0
E/AndroidRuntime( 241):
at android.app.ActivityThread.performResumeActivity
at android.app.ActivityThread.handleResumeActivity
at android.app.ActivityThread$H.handleMessage
at android.os.Handler.dispatchMessage
at android.os.Looper.loop
at android.app.ActivityThread.main
...
E/AndroidRuntime( 241): Caused by:
android.database.CursorIndexOutOfBoundsException:
Index 0 requested, with a size of 0
at android.database.AbstractCursor.checkPosition
at android.database.AbstractWindowedCursor.checkPosition
at android.database.AbstractWindowedCursor.getString
at android.database.CursorWrapper.getString
at com.google.android.wikinotes.WikiNotes.onResume
at android.app.Instrumentation.callActivityOnResume
at android.app.Activity.performResume
at android.app.ActivityThread.performResumeActivity
... 10 more
I/ActivityManager( 49): Process com.google.android.wikinotes has died.
Then all the WikiNotes windows die... There are a lot!
I/WindowManager( 49): WIN DEATH: Window{43519778
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{434e53c8
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotesList}
I/WindowManager( 49): WIN DEATH: Window{434a3008
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotesList}
I/WindowManager( 49): WIN DEATH: Window{435092c8
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{4346bac0
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{43555a28
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{43453448
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{43548878
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotesList}
I/WindowManager( 49): WIN DEATH: Window{434be5e8
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{434cfbe0
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{434ab348
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{4341cd50
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{43442488
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotesList}
I/WindowManager( 49): WIN DEATH: Window{434b4eb8
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotesList}
I/WindowManager( 49): WIN DEATH: Window{434d1840
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{43512458
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}
I/WindowManager( 49): WIN DEATH: Window{4353e098
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotesList}
I/WindowManager( 49): WIN DEATH: Window{43478fe8
com.google.android.wikinotes/
com.google.android.wikinotes.WikiNotes}