This method is actually called automatically whenever the SQLiteOpenHelper methods getWritableDatabase() or getReadableDatabase() is/are called.
You cannot call this manually.
The reason for this being that the database is already created. If you want onCreate() to be called again, you can delete the database and run your app again.
To do so in Eclipse, do the following:
- Go to Window > Show View > Android > File Explorer
- Go to data folder
- Look for your app’s package name, the database should be there
If you are the hardcore type, you can use the adb shell command. Log into the shell and then use the “rm” command to delete your database file.
Or, just uninstall your app from the Android emulator. This removes not only the app, but your database as well.