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