是否可以从SQLite数据库填充ListView而无需先将数据保存到数组或列表中?我的SQLite数据库中大约有20000行数据。
谢谢!
是。这个有可能。使用a直接从数据库中SimpleCursorAdapter
填充您ListView
的数据。为了避免在UI线程(startManagingCursor
和stopManagingCursor
)上执行数据库操作,建议使用CursorLoader
-加上ContentProvider
-来异步加载数据。了解更多... http://developer.android.com/guide/components/loaders.html https://developer.android.com/training/load-data-background/setup-loader.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句