When the mainactivity tries to open the database for the first time after the app is installed, the SQLiteHelper Oncreate method is triggered (as one would expect). I want
You should not attempt to call getWritableDatabase()
or getReadableDatabase()
from SQLiteOpenHelper
lifecycle methods such as onCreate()
or methods called from there. That will fail with a "called recursively" exception.
Instead, use the SQLiteDatabase
that is given as a parameter to onCreate()
or other lifecycle methods.