Android 数据库查询报错

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.Cursor android.database.sqlite.SQLiteDatabase.rawQuery(java.lang.String, java.lang.String[])' on a null object reference

        报错行代码:Cursor cursor = mSQLiteDatabase.rawQuery("select * from users",null);


慕虎7371278
浏览 563回答 2
2回答

largeQ

mSQLiteDatabase需要声明定义一下

森栏

Cursor cursor = mSQLiteDatabase.rawQuery("select * from users",new String[0]);
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Android