开发者

Android ListAdapter Repaint

i have the following problem. I fill a ListView with a custom ArrayAdapter with 开发者_如何学Cdata from a BD. However, in background, i'm updating those datas from the info provided by an API, so the idea is when the update finish, the adapter shows the updated data instead its "old version".

The problem is that when i do that, i notice a lag while the adapter is updating itself. Is the any efficient solution to avoid this?

Thanks


You can call notifyDataSetChanged() on your ListAdapter to cause it to update to the current data immediately. Note that you should do this from the main UI thread, using a Handler or Activity.runOnUIThread()

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜