Skip to content Skip to sidebar Skip to footer

Rearrange List View Items In Simplecursoradapter

I have a database SQLite and then using SimpleCursorAdapter , I display values into list view. However, I want to re arrange the list view items and display the ones starting with

Solution 1:

If you are using SQLite correctly you should be able to do a "order by id" when you query up the DB.

If thats not the case then what I would do is build out your data into a collection.

Have your generic object implement the comparable interface.

like so http://www.java-tips.org/java-se-tips/java.lang/how-to-use-comparable-interface.html

When you call Collections.sort(contentfromtheprovider); It will sort based on the ID like you wish to do.

Solution 2:

just format your query, here's the page that helped me.

http://msdn.microsoft.com/en-us/library/bb264565%28v=sql.90%29.aspx

Post a Comment for "Rearrange List View Items In Simplecursoradapter"