If you receive data through the cursor and fill in the data on the screen, for example, set the window title in onStart() or onResume() ?
onStart() will seem like a logical place, because after onStart() activity can already be displayed , albeit in the background. It is noteworthy that I had a problem with a controlled dialogue , which made me rethink this. If the user rotates the screen while the dialog is still open, onCreateDialog() and onPrepareDialog() are called between onStart() and onResume() . If the dialog should be based on the data that is needed for the data before onResume() .
If I'm right about onStart() , then why does the Notepad example give a bad example by running it in onResume() ? See http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.html NoteEditor.java line 176 ( title = mCursor.getString... ).
Also, what if my activity starts another Actvity / Dialog, which changes the data that the cursor is tracking. Even in the simplest case, this means that I need to manually refresh my previous screen (the listener for the dialog in the main action) or, alternatively, I have to register ContentObserver, m no longer updates the data in onResume () (although I could update it twice) ?
I know this is a basic question, but dialogue only recently, to my surprise, made me realize this.
pjv
source share