title: Fetching a single value from SQLite
body: <p>This method is in databasehelperclass returning single value expected</p>
  
  <pre><code>  public Cursor getUserDataFromDb(){
      SQLiteDatabase sqLiteDatabase=this.getWritableDatabase();
      Cursor rawdata=sqLiteDatabase.rawQuery("SELECT NAME FROM " +TABLE_NAME+" ORDER BY ID DESC LIMIT 1)",null);
      return rawdata;
  
  }
  </code></pre>
  
  <p>fetching value from usertable inside an Activity</p>
  
  <pre><code>    try {
          Cursor cursor = mydb.getUserDataFromDb();
          if (cursor.moveToFirst()){
             name_resultfromdb = cursor.getString(0);
          }
          else {
              Toast.makeText(this,"Setup your Account",Toast.LENGTH_LONG).show();
          }
  
      }catch (Exception e){
          e.printStackTrace();
      }
  </code></pre>
  
  <p>I am using the above code to get the data, but I am getting null.<br>
  I want to show this value into a TextView, but I am unable to get it.</p>