Skip to content

Instantly share code, notes, and snippets.

@shirou
Created September 27, 2010 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shirou/598747 to your computer and use it in GitHub Desktop.
Save shirou/598747 to your computer and use it in GitHub Desktop.
public void setView(View child){
ViewGroup parent = (ViewGroup) child.getParent();
if (parent != null){
parent.removeView(child);
}
mainLayout.removeAllViews();
mainLayout.addView(child);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment