java.lang.NullPointerException: Attempt to invoke virtual method 'void android.database.sqlite.SQLiteDatabase.execSQL(java.lang.String)' on a null object reference

Stack Overflow | Moses | 9 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    How to insert values retrieved from one app's database to another?

    Stack Overflow | 9 months ago | Moses
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.database.sqlite.SQLiteDatabase.execSQL(java.lang.String)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.database.sqlite.SQLiteDatabase.execSQL(java.lang.String)' on a null object reference

      at com.canre.backup1.DatabaseHelper.onCreate()
    2. com.canre.backup1
      DatabaseHelper.onCreate
      1. com.canre.backup1.DatabaseHelper.onCreate(DatabaseHelper.java:25)
      1 frame
    3. Android Platform
      SQLiteOpenHelper.getWritableDatabase
      1. android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:251)
      2. android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
      2 frames
    4. com.canre.backup1
      MainActivity.onLoadFinished
      1. com.canre.backup1.DatabaseHelper.insertData(DatabaseHelper.java:34)
      2. com.canre.backup1.MainActivity.onLoadFinished(MainActivity.java:58)
      3. com.canre.backup1.MainActivity.onLoadFinished(MainActivity.java:22)
      3 frames