Getting Null Pointer Exception while reading sqlite database
- by user1597569
I have to read values from SQLite database but getting null pointer exception when I execute
private final String DB_NAME = "UserDb";
private final String TABLE_NAMES = "tbluser";
SQLiteDatabase sampleDB;
Cursor c=null;
c= sampleDB.rawQuery("SELECT * from " +TABLE_NAMES+" where did='"+deviceDec+"' ",
null);
Please suggest me why I am getting the exception because at one function it is running but in other it is not. and the deviceDec value also i am getting I have checked in Log