I am making an application to display music in an iTunes like view. It is a tableLayout which is created from a SQLite database. I load the list of songs into the table using an asyncTask at startup. This works great for 0-100 ish songs, but too many more and the startup time is huge as is the ram usage. It feels very unnecessary to load the entire database into ram at one time even on a separate thread as only a few rows can be seen at one time. How can I dynamically load and unload the rows from this view as the user scrolls?
Share
You are looking for Cursors and Cursor Adapters. These mechanisms are provided to do exactly what you are looking for.