title: adding linear layout to current view
body: <p>I'm sure this has come up often, but I couldn't find an exact solution for my issue. I'm simply trying to programmatically create a linear layout with a textview and 2 buttons and add it to the bottom of my fragment (which is also a linear layout). I.e. I want it to appear below the other views on the screen not the actual bottom. However, when I try to add it, it always appears at the top corner and not the end. Here's my code:</p>
  
  <pre><code>LinearLayout layout = new LinearLayout(getActivity());
      layout.setOrientation(LinearLayout.VERTICAL);
      layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
      layout.setBackgroundColor(Color.CYAN); 
  
    TextView noteView = new TextView(getActivity());
      LayoutParams lparams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
      noteView.setLayoutParams(lparams);
      noteView.setText(noteText);
  
  layout.addView(noteView);
  getActivity().addContentView(layout, lparams);
  </code></pre>
  
  <p>}</p>