title: How to get the id of the last inserted row in the SQLite db using AsynQueryHandler
body: <p>I am inserting a row in the SQLite DB using <code>AsyncQueryHandler</code> and trying to get the <code>id</code> of newly inserted row inside <code>onInsertComplete</code> method as shown in the <code>try-catch</code> bellow but i am getting the exception: <code>java.lang.NullPointerException: unable to parse 'lectureTimeTable' (this is my table name in which i have inserted a row.)</code></p>
  
  <p>I am following <a href="https://stackoverflow.com/q/11488035/1773155">This StackOverflow question.</a></p>
  
  <p>I want to know a way to get the id of last inserted row in the following situation! </p>
  
  <pre><code>AsyncQueryHandler mAsyncQueryHandler = new AsyncQueryHandler(getContentResolver()) {
          @Override
          protected void onInsertComplete(int token, Object cookie, Uri uri) {
              super.onInsertComplete(token, cookie, uri);
  
              switch (token) {
              case MyConstants.TOKEN_INSERT_LECTURE_TIME:
  
                  try {
                      int newlyInsertedLectureTimeId = Integer.valueOf(uri
                              .getLastPathSegment());
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
  
              default:
                  break;
              }
          }
      };
   mAsyncQueryHandler.startInsert(
                      MyConstants.TOKEN_INSERT_LECTURE_TIME, new Object(),
                      CourseLectureTime.CONTENT_URI, lectureTimeCV);
  </code></pre>