Attached is my attempt at an adapter which uses an ORMLite PreparedQuery
to gather and display data for Spinner's and ListView's.
The class has 2 constructors, one which uses the PreparedQuery to get the
Android SQLite cursor, and one which takes the cursor as an argument. In
the first case, since the adapter is constructed in the UI thread, the
cursor is also retrieved in the UI thread, which means the PreparedQuery
is executed on the UI thread... which is definitely not good. However, the
second constructor is harder/messier to use. I don't know what the clean
solution is.
I'd love to receive some feedback on this approach, and hopefully get it
included in ORMLite-Android soon :-)
Thanks,
~Craig