title: Android Sqlite get last insert row id
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5409751/get-generated-id-after-insert">Get generated id after insert</a>  </p>
  </blockquote>
  
  
  
  <p>I want to get the last inserted row id in my android application using this code :</p>
  
  <pre><code>String query = "SELECT * from SQLITE_SEQUENCE";
  int createdUserId = Integer.parseInt(dbHelper.executeSQLQuery(query).toString());
  </code></pre>
  
  <p>but the problem is that it's throws an exception that cannot convert <code>dbHelper.executeSQLQuery(query).toString()</code> to integer. I'm not really good at sqlite ,but i think that this should return the last row id which was inserted...which will definitely will be int (at least I think this way). So if this is not the right way, can someone please guide me how to get the last row id in android application.</p>
  
  <p>Thanks!!!</p>