java.lang.RuntimeException

Unable to start activity ComponentInfo{com.mahdishekari.mycollectbill/ghabz.mahdishekari.app.Scann}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase android.content.Context.openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase$CursorFactory, android.database.DatabaseErrorHandler)' on a null object reference

Solutions on the web45928

  • Unable to start activity ComponentInfo{com.mahdishekari.mycollectbill/ghabz.mahdishekari.app.Scann}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase
  • Unable to start activity ComponentInfo{com.mahdishekari.mycollectbill/ghabz.mahdishekari.app.Scann}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase
  • Unable to start activity ComponentInfo{com.example.max.pswi/com.example.max.pswi.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase android.content.Context.openOrCreateDatabase
  • Stack trace

    • java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mahdishekari.mycollectbill/ghabz.mahdishekari.app.Scann}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase android.content.Context.openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase$CursorFactory, android.database.DatabaseErrorHandler)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2440) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2500) at android.app.ActivityThread.access$900(ActivityThread.java:163) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1362) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5585) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase android.content.Context.openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase$CursorFactory, android.database.DatabaseErrorHandler)' on a null object reference at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:269) at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223) at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163) at ghabz.mahdishekari.app.C0238u.m1320a(C0238u.java:30) at ghabz.mahdishekari.app.Scann.onCreate(Scann.java:81) at android.app.Activity.performCreate(Activity.java:6279) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2393) ... 9 more

    Write tip

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

    Users with the same issue

    Unknown user
    Once, 10 months ago
    Unknown user
    Once, 10 months ago
    Unknown user
    2 times, 1 year ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago