title: findViewById is null, am I not in the right View?
body: <p>MainActivity.java:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
      protected void onCreate(Bundle savedInstanceState) {
          setContentView(R.layout.activity_main);
      }
      public void OnClickSendButton(View view) {
          EditText editTxt = (EditText) view.findViewById(R.id.MessageEditText);
          CharSequence toastText = editTxt.getText().toString();
      }
  }
  </code></pre>
  
  <p>activity_main.xml:</p>
  
  <pre><code>&lt;GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      tools:context="com.example.faridahamat.androidlayout.MainActivity"&gt;
  
      &lt;EditText
          android:id="@+id/MessageEditText"/&gt;
      &lt;Button
          android:onClick="OnClickSendButton"/&gt;
  &lt;GridLayout/&gt;
  </code></pre>
  
  <p>I already called the <code>setContentView</code> to use the <code>activity_main.xml</code>, so why am I still not able to get the <code>MessageEditText</code>'s content? If <code>MainActivity</code> already uses the <code>activity_main.xml</code> as its layout, shouldn't I be able to get whatever that is inside that layout by calling Views that are inside?</p>
  
  <p>I'm newbie, so my understanding of <code>Activity</code>/<code>View</code> might be wrong, please explain.</p>