Let say we are in landscape and I have one root container
in that container other two(smaller). I want at run time to swap places of cotainers. The container A to go to the place of B and B to go to the place of the layout A.
My layout is defined in xml. So what is the best way to make two element to swap places ?
Is is good to change the properties of for example RelativeLayout.LayoutParams ?
First of all for scenario like this , what is the best layout to be used for the root container ?
after the call of setContentView(R.layout.mylayout);
and after root=findViewById(R.id.root); , a=findViewById(R.id.a);, b=findViewById(R.id.b);
should I remove the child views from the root layout ?
like root.removeallview(); ? or there is something else that I should do ?
I need someone with experience to explain me how should this kind of things done, of course evry suggestion is welcomed and if you have some useful links please share with me.
I want to be able to swap between this two different ways of presenting the layouts.


If you put these views into Fragments, then you can move the fragments around using a FragmentTransaction.