views:

22

answers:

0

My application has an Activity and this Activity displays different Views depending on the context. I switch Views by using a combination of setVisibility() because I have only 1 XML file with every different View. The problem is that when changing Views like:

mCurrentView.setVisibility(View.GONE);
mNextView.setVisibility(View.VISIBLE);

I'm seeing an animation, like mCurrentView floating to the left, while mNextView appearing from the right, and I want to avoid this animation.

How do I avoid the animation when setting visibility of the Views?