activity.OnCreate is executed every time the app launches or the screen is rotated, so, putting your DB initialization inside it will cause the DB to be called too many times causing the exception. Try to use the MyDatabase.onCreate method for this.
Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.
android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed
at android.database.sqlite.SQLiteStatement.native_execute(Native Method)
You have a different solution? A short tip here would help you and many other users who saw this issue last week.