开发者

Android fast running sqlite query

开发者 https://www.devze.com 2023-03-11 03:06 出处:网络
I\'m using a database for searching and facing followi开发者_开发问答ng issue. When new search string comes I need to block the previously executing database query.

I'm using a database for searching and facing followi开发者_开发问答ng issue.

When new search string comes I need to block the previously executing database query.

How can I do this?


You cannot stop a query as the request to the database is synchronous. But you can try to exclude the request to the database into a thread so you can stop the thread when a new request should be done.

Anyway it would be a good idea to do the query in a thread oder AsyncTask so you don't block the UI when querying the database.

0

精彩评论

暂无评论...
验证码 换一张
取 消