开发者

Android fast running sqlite 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜