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,322
  • 5
  • 30
  • 40

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,410
  • 12
  • 37
  • 51
2

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

listView.invalidateViews();
Parag Chauhan
  • 35,760
  • 13
  • 86
  • 95
1

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

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

instanceMaster
  • 456
  • 3
  • 12