title: Is it safe to delete rows from Android SQLite database while iterating cursor
body: <p>For example:</p>
  
  <pre><code>public void removeStaleMovies(Set&lt;String&gt; updatedMovieList) {
      Cursor cur = this.getReadableDatabase().rawQuery("SELECT id, title, year FROM movie", null);
      cur.moveToFirst();
      while (!cur.isAfterLast()) {
          String title = cur.getString(1);
          String year = cur.getString(2);
          if (!updatedMovieList.contains(title + "-" + year)) {
                // delete the row where 'id' = cur.getString(0)
                // OR, delete the row using the object at the cursor's current position, if that's possible
                // OR, if deletion isn't safe while iterating, build up a list of row id's and run a DELETE statement after iteration is finished    
          }
  
      }
  }
  </code></pre>
  
  <p>Is deletion safe to do? Or can it result in some unpredictable behavior? I am aware of <a href="https://stackoverflow.com/questions/4929103/delete-current-row-in-sqlite3-while-iterating-over-a-result-set">this similar question</a>, but I'm still unsure.</p>