I have built my interface by using ViewStubs, which I inflate during onCreate.
But later in my app, I want to change the View completely, by loading different View into the same place. How do I achieve that?
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.
Remove the old
ViewviaremoveView(). Then inflate and add the replacement viaaddView().Though if you’re going to be bouncing back and forth a lot, consider using a
FrameLayoutorViewFlipperor something to have both views loaded at once, only making one visible.