title: cannot add view to nested linear layout in fragment
body: <p>I want to build whole fragment layout programatically and dynamically. So I've created this code:</p>
  
  <pre><code>@Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      final View view = inflater.inflate(R.layout.empty_container, container, false);
  
      final FrameLayout rootView = (FrameLayout) view.findViewById(R.id.empty_container);
  
      final LinearLayout linearLayout = new LinearLayout(getActivity());
      linearLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
      linearLayout.setOrientation(LinearLayout.HORIZONTAL);
      linearLayout.setBackgroundColor(Color.BLACK);
  
      rootView.addView(linearLayout);
  
      final Button button = new Button(getActivity());
      button.setBackgroundColor(Color.GREEN);
      button.setText("button name");
      button.setLayoutParams(new LinearLayout.LayoutParams(100, 100));
  
      linearLayout.addView(button);
  
      return view;
  }
  </code></pre>
  
  <p>and the xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout
      android:id="@+id/empty_container"
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"/&gt;
  </code></pre>
  
  <p>I cant figure out why this is not working properly. Button is not visible at all (but linear layout is visible - whole screen is black). When I set one of button Layout params to <code>MATCH_PARENT</code> it suddenly appears, but when I set it to 100 px or <code>WRAP_CONTENT</code> its not showing.</p>