ardovic / Open-Source-Android-Weather-App

☔️ Open source android weather app. See "Issues" tab for current tasks queue. Tasks suitable for beginners are labeled with green "beginner friendly" tags.
https://www.ardovic.com
MIT License
104 stars 81 forks source link

Migrating to CursorLoader & LoaderManager for AutoCompleteTextView with SQLiteDatabase #1

Closed ardovic closed 6 years ago

ardovic commented 6 years ago

We have an AutoCompleteTextView, which shows dropdown list of suggestions taken from a SQLiteDatabase query. At the moment it uses SimpleCursorAdapter, however there are several problems with it (I have a separate question about the issue here: SimpleCursorAdapter issue - "java.lang.IllegalStateException: trying to requery an already closed cursor").

Nevertheless, I was advised to look in the direction of CursorLoader and LoaderManager, and I've tried it, yet couldn't make it work. I'd be grateful if someone would guide/recommend/show the right way of migrating my code below to CursorLoader/LoaderManager concept. Any kind of help very appreciated!