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()
精彩评论