java.lang.RuntimeException: An error occured while executing doInBackground()


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.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • bug on push
    via GitHub by idelcano
  • Create daily crashes the app
    via GitHub by franzejr
  • Crash - Saving Daily
    via GitHub by negue
  • GitHub comment 57#157201848
    via GitHub by franzejr
    • java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done( at java.util.concurrent.FutureTask.finishCompletion( at java.util.concurrent.FutureTask.setException( at at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at Caused by: android.database.sqlite.SQLiteConstraintException: column event is not unique (code 19) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId( at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId( at android.database.sqlite.SQLiteStatement.executeInsert( at at at at at at at at at at at at$13.execute( at$13.execute( at at at at

    Users with the same issue

    Hiren Amaliyar
    Hiren Amaliyar1 times, last one,
    dealloc4 times, last one,
    bayukresno617 times, last one,
    xavilo1 times, last one,
    jk2 times, last one,
    68 more bugmates