title: PopupWindow show from fragment - The specified child already has a parent. You must call removeView() on the child's parent first
body: <p>I'm trying to show a PopupWindow from a Fragment but it not works.
  I've got the error:</p>
  
  <p><code>java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.</code></p>
  
  <p>My code is:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      View rootView = inflater.inflate(R.layout.fragment_layout, container, false);
      buttton = (Button)rootView.findViewById(R.id.my_button);
      button.setOnClickListener(new View.OnClickListener() {
           public void onClick(View v) {
                LayoutInflater layoutInflater (LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);  
                View popupView = layoutInflater.inflate(R.layout.popup_window, null, false);
                PopupWindow popupWindow = new PopupWindow(popupView, 450, 640);
                popupWindow.showAsDropDown(v);
           }
      });
  </code></pre>
  
  <p>I can't understand what's the "specified child" from the error.
  How can I solve this problem?
  Thanks</p>