title: How do I show text and a button? (android)
body: <p>I'm working on an app that generates a random quote (from a switch) when you press a button. This then goes to the next screen, where it then displays it as a textView. That part works. I want a button under this, which would send the user back to the main screen (I also plan on having two other buttons but those will come later). However, the app is only displaying either the text or the button, not both.</p>
  
  <pre><code>    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_comp_out);
      Intent intent = getIntent();
      String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
  
      // Create the text view
      TextView textView = new TextView(this);
      textView.setTextSize(40);
      textView.setText(message);
  
      Button button = new Button(this);
      button.setText("Main Menu");
      button.setTextColor(Color.parseColor("#ff0000"));
      button.setHeight(75);
  
  
      // Set the text view as the activity layout
      setContentView(textView);
      setContentView(button);
  }
  </code></pre>
  
  <p>This is the code I'm using to create the text output and the button. the String message is the quote. This code is making a button that fills the whole screen though.</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" 
  android:background="@color/orange"&gt;
  
  &lt;Button
      android:id="@+id/button1"
      android:layout_width="match_parent"
      android:layout_height="50dp"
      android:layout_marginEnd="5dp"
      android:layout_marginStart="5dp"
      android:layout_marginTop="5dp"
      android:textColor="@color/blue"
      android:text="@string/button_menu" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Without the java code making a button, I was using this, which wasn't making a button either. (Also the background wasn't being set to orange, but thats not a big deal) Any ideas on how to put the button under the text?</p>