I’m making an app that uses a SQLite database to store data. Sometimes my app freezes when switching between activities that access the database, especially when the activity being started accesses the database in the onCreate() method.
Should I:
- Access the database using an async task or similar
- Use some kind of pipeline to control database requests?
Could you point me to relevant code samples if nessecary please?
Thanks in advance!
I have a better solution:
I am using a pipeline system, where I have runnables that are posted into the pipeline that get executed in the order they were posted. I find this solution easy to manage, neat and efficient.
An example of pipelining is here: http://mindtherobot.com/blog/159/android-guts-intro-to-loopers-and-handlers/