I m coding some ui screens on android. sometime I need to see ui changes immediately, but that changes can be seen on next ui thread request. so, for example if I remove a view on screen and add another view programmatically, then change whole view (with viewAnimator), removing view can be observed, but new view can not be observed. I m sure new view is added, because when I go back to first page, new view is on screen.
which function should I call add or remove some view on screen to see its effect immediatlety ?
I tried invalidate(), but it doesnt work for my case
invalidate() on views that have no drawable (even transparen) or no children is not called.
You have to at setBackgroundDrawable(Color.Transparent) to all of them or add a dummy child view at development to observe changes.
Also notice that at Android 3 + the rendering system has changed. When you invalidate parent the children are not always invalidated. You should invalidate the whole tree manually if you want the same beahvior as lower versions