android - How to avoid Listview to reset location after notifyDataSetChanged? -


i put listview in center of screen.and start animation:

hideanimation= new translateanimation(0, -220, 0, 0); hideanimation.setduration(500); hideanimation.setfillbefore(false); hideanimation.setfillafter(true); hideanimation.setanimationlistener(this); 

and in method onanimationend, clear animation , set layout this:

mlistview.layout(-220, 0, 500, 500); 

and works fine far. after mlistview.layout(-220, 0, 500, 500), need refresh listview.so call

adapter.notifydatasetchanged(); 

then listview came screen center...

anyone knows how deal this?

save location in parameters x , y , z after calling notifydatasetchanged can this

yourlistview.setlocation(x,y,z); 

and listview add function

public setlocation(int x, int y, int z){ //do whatever want } 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -