2

I'm developing an application that shows stock market information. In my application I use listactivity and my own adapter is being used. The listView used to show the stocks is working fine and is updated with correct data. The only problem is, although I use

 adapter.notifyDataSetChanged(); 

the list isn't updated until scrolling and items subjected to change, are scrolled out from the screen. When they are scrolled in, they appear with new data. I need to change the data as soon as I notify the adapter.

Daniel
  • 3,224
  • 4
  • 26
  • 37

3 Answers3

2

I think for that you have to take the help of the Lazy ListView or Lazy Loader:

Check out the below link :

Lazy load of images in ListView

It will help you.

Community
  • 1
  • 1
mayur rahatekar
  • 4,240
  • 11
  • 36
  • 49
2

I have face same problem but finally got solution And its solution is

listView.invalidateViews();
Parag Chauhan
  • 34,968
  • 13
  • 85
  • 95
1

Are you calling notifyDataSetChanged in UI thread? If not: you can do the following:

runOnUiThread(new Runnable() { public void run() { adapter.notifyDataSetChanged(); } });

yfranz
  • 436
  • 3
  • 12