Altering SQLite cursors?
<p>I have an SQLite table Task, and I would like to display the 5 tasks with the highest "priority" in a ListView. </p>

<p>Priority is a complex calculation, so I can't just compute it in SQL and order/limit the result.</p>

<p>To achieve that goal, I was thinking about getting a Cursor with all the tasks, going through the rows to compute and set a "priority" number, and delete/reorder the rows of the cursor so that it shows only the first 5.</p>

<p>From what I found, I can set a "priority" value to a row by extending Cursor so that it exposes CursorWindow.</p>

<p>Unfortunately, I haven't found a way to alter the rows of the Cursor to delete/order them. </p>

<p>Is there a way to do that? If not, I'm also open to other efficient design alternatives.</p>

<p>Of course, I could add a "priority" column in my table, update it every time, and then do the selection with order/limit, but that's not very efficient.</p>

<p>I guess I could also do filtering/ordering in the adapter, but I don't think that's the kind of job an adapter is supposed to do.</p>