Assuming you want to insert your three courses to the database only once when the database is created:
Move the insert code to database helper
onCreate()
. It gets called once when the database file didn't exist to start with. Use theSQLiteDatabase
supplied as an argument there instead of callinggetWritableDatabase()
recursively.Insert three times.
ContentValues
put()
overwrites any value with the same key so essentially you're only really inserting your third course.