title: Android SQLite wrapper keeps query open in CursorAdapter, is this good?
body: <p><strong>EDIT</strong> the assumption of this question is wrong, Android doesn't keep the query open, but it can cause other problems. See discussion bellow...</p>
  
  <hr>
  
  <p>The Android Cursor implementation keeps a scrolling window of the underlining SQLite cursor, so it can implement "move forwards".</p>
  
  <p>But I found a old SQLite documentation saying this is a bad practice, and you should not leave query open for UI inputs:</p>
  
  <p><a href="https://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor" rel="nofollow noreferrer">https://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor</a></p>
  
  <p>Also for example Telegram use it's own wrapper of SQLite, and don't have the scrolling cursor. <a href="https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/SQLite/SQLiteCursor.java" rel="nofollow noreferrer">https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/SQLite/SQLiteCursor.java</a> . They only have "next"</p>
  
  <p>Also there is the "best practice" to call "getCount" in CursorLoader, if you look at the implementation, it actually tries to loop through all the data in the underlining query.</p>
  
  <hr>
  
  <p>So is Android's wrapper implementation bad? Is SQLite doc outdated and it is ok to keep query open?</p>