title: GET MAX ID ROW OF A TABLE
body: <p>My question is about how get the max id row of a table... I'm using max function but give me a error</p>
  
  <p><img src="https://i.stack.imgur.com/E9JR4.png" alt="enter image description here"></p>
  
  <p>Here is my code</p>
  
  <pre><code>     public static long getLastIdQuotaAdded(Context context){
      long id;
      Cursor cursor;
      String selection = null;
      String[] selectionArgs = null;
  
      selection = "MAX(" + C_ID + ")";
  
      cursor=context.getContentResolver().query(URI, ALL_COLUMNS, selection, selectionArgs, null);
      id = cursor.getLong(cursor.getColumnIndex(C_ID));
      return id;
  }
  </code></pre>
  
  <p>Thank you for yout help... :)</p>