title: Getting NullPointerException while reading Sqlite database
body: <p>I have to read values from  SQLite database but getting <code>NullPointerException</code> when I execute </p>
  
  <pre><code>   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);
  </code></pre>
  
  <p>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.</p>