Is it possible to populate a ListView from a SQLite Database without saving the data to an Array or List first? I have about 20000 lines of data in my SQLite Database.
Thanks!
Is it possible to populate a ListView from a SQLite Database without saving the data to an Array or List first? I have about 20000 lines of data in my SQLite Database.
Thanks!
You can use CursorAdapter to achieve this. Here goes a tutorial: http://www.mysamplecode.com/2012/07/android-listview-cursoradapter-sqlite.html
Yes. This is possible. Use a SimpleCursorAdapter
to populate your ListView
directly from a database. To avoid performing database operations on the UI thread (startManagingCursor
and stopManagingCursor
), it is recommended to use a CursorLoader
- backed by a ContentProvider
- in order to load data asynchronously. Read more... http://developer.android.com/guide/components/loaders.html https://developer.android.com/training/load-data-background/setup-loader.html