I’m relatively new to Android but I just cant google this. I have following situation:
-
quite large SQL db on android (need to select and load about 2000 records to ListActivity)
-
I use SimpleCursorAdapter so far BUT… it doesn’t allow me to load data asynchronously with AsyncTask (SimpleCursorAdapter has no “add()” as e.g. ArrayAdapter does)
-
I know how to make it work with ArrayAdapter but then I lose the ID attribute every time the time is clicked and I want to do it the “clean” way and keep the id (not save it some place hidden)
===> For now user has to wait till all db output is parsed into GUI, it takes some time. How can I fix it to make it run faster ? I need something like SimpleCursorAdapter.add(item) or extend it but not sure …
thnx
You should consider having some pagination mechanism, not loading everything in an ArrayAdapter but better, returning a simpleCursorAdapter with just a subset of size N of your records. When the user will reach the last row, display a button to increase N and refetch the data from your database.