Can somebody explain me the flow of control in this tutorial : http://www.vogella.de/articles/AndroidSQLite/article.html#tutorialusecp
I am not able to get the right flow. I am completely a novice to this content provider etc.
I wanted to know when does actually the DB gets created, what are the lifecycle methods and what is the sequence of method execution in this project ?
Finally found the Flow!! :
First of all, the
onCreateof Content Provider is called just when the application launches as we have registered this in Manifest.Then,
onCreateof our first Activity, i.e.onCreateof ToDodOverviewActivity.the call to
fillData()has theinitLoader()call which in turn calls theonCreateLoaderof the Loader.Then, here at
creation of Loader takes place. a loader that queries the ContentResolver and returns a Cursor. This class implements the Loader protocol in a standard way for querying cursors, building on AsyncTaskLoader to perform the cursor query on a background thread so that it does not block the application’s UI.
This in turn leads a call to
onCreate()of DataHelper and ToDoTable etc and here everyone know the flow about SQLiteOpenHelper.Finally,
onLoadFinished()gets called which in turn swaps the cursor and updates the adapter.