In my activity there are two views. Both are in different parents. I have their coordinates with respect to the screen. How to interchange the location of the two views?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need to call the parent ViewGroup method
removeView()for both views thenaddView()to add them back but swapper about.So if your parent views are called mommy and daddy, one has a child called foo, the other a child called bar:
Read the reference for ViewGroup for more information about the removeView and addView methods and to see other available methods.