Android SQLite Null Pointer Exception

后端 未结 2 1037
礼貌的吻别
礼貌的吻别 2021-01-04 04:14

I am getting this in LogCat:

05-20 17:16:34.721: E/AndroidRuntime(30461): FATAL EXCEPTION: main
05-20 17:16:34.721: E/AndroidRuntime(30461): java.lang.NullPo         


        
2条回答
  •  花落未央
    2021-01-04 04:42

    The best is to use the SQLiteOpenHelper class which takes care for providing instance of SQLiteDatabase, it's singleton pattern:

    see Android: java.lang.IllegalStateException: database xxx.db (conn# 0) already closed

提交回复
热议问题