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
Post a Comment