title: SQLite, getting last item in table
body: <p>I need some help with using the database that I created. I need to access the last item in the database. This is my code that gets a single item. How can I change it to only get the last?</p>
  
  <pre><code>// Getting single user
  User getuser(int id) {
      SQLiteDatabase db = this.getReadableDatabase();
  
  
      Cursor cursor = db.query(TABLE_USER, new String[] { KEY_ID,
              KEY_NAME, KEY_AGE, KEY_WEIGHT, KEY_HEIGHT, 
              KEY_GOAL, KEY_BMI }, KEY_ID + "=?",
              new String[] { String.valueOf(id) }, null, null, null, null);
  
      if(cursor!=null &amp;&amp; cursor.getCount()!=0){
            cursor.moveToFirst();
      }
  
      User user = new User(Integer.parseInt(cursor.getString(0)),
              cursor.getString(1), cursor.getInt(2),cursor.getInt(3), cursor.getInt(4), 
              cursor.getString(5), cursor.getFloat(6));
      return user;
  }
  </code></pre>