title: android studio specifically R.id.editText
body: <p>Hello this is my first time creating a beginners application with android studio and i have been following step by step to create the tutorial message app but i have run into a problem which I'm hoping someone could clarify what i am missing or what I'm doing wrong but when calling the findViewById(R.Id.editText); portion of the code to show the edit text section on the second activity it cannot find the referenced symbol and i cannot add the reference by pushing alt+enter as it does not show an option to import and i have no idea what a resource value is or creating a Field for it does.</p>
  
  <p>This is the MainActivity.java file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>package com.example.myfirstapp;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.view.View;
  import android.widget.EditText;
  
  
  
  public class MainActivity extends AppCompatActivity {
      public static final String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
      /** Called when the user taps the Send button */
      public void sendMessage(View view) {
          Intent intent = new Intent(this, DisplayMessageActivity.class);
          EditText editText = (EditText) findViewById(R.id.editText);
          String message = editText.getText().toString();
          intent.putExtra(EXTRA_MESSAGE, message);
          startActivity(intent);
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is the activity_main.XML file</p>
  
  
  
  
  
  <pre><code>        &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context="com.example.myfirstapp.MainActivity"&gt;
  
          &lt;TextView
              android:id="@+id/textView"
              android:layout_width="0dp"
              android:layout_height="28dp"
              android:layout_marginEnd="16dp"
              android:layout_marginStart="16dp"
              android:layout_marginTop="16dp"
              android:hint="@string/edit_message"
              app:layout_constraintEnd_toStartOf="@+id/button"
              app:layout_constraintHorizontal_bias="0.5"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent" /&gt;
  
          &lt;Button
              android:id="@+id/button"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginStart="16dp"
              android:onClick="sendMessage"
              android:text="@string/button_send"
              app:layout_constraintBaseline_toBaselineOf="@+id/textView"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintHorizontal_bias="0.5"
              app:layout_constraintStart_toEndOf="@+id/textView" /&gt;
      &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  
  
  <p>This is my DisplayMessageActivity.java File</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>package com.example.myfirstapp;
  
  import android.content.Intent;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.widget.TextView;
  
  public class DisplayMessageActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_display_message);
  
          // Get the Intent that started this activity and extract the string
          Intent intent = getIntent();
          String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
  
          // Capture the layout's TextView and set the string as its text
          TextView textView = findViewById(R.id.textView);
          textView.setText(message);
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is my activity_display_message.xml</p>
  
  
  
  
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.myfirstapp.DisplayMessageActivity"&gt;
  
      &lt;TextView
          android:id="@+id/textView2"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginEnd="16dp"
          android:layout_marginStart="16dp"
          android:layout_marginTop="16dp"
          android:text="TextView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  
  
  <p>This is my Strings.xml</p>
  
  
  
  
  
  <pre><code>&lt;resources&gt;
      &lt;string name="app_name"&gt;My First App&lt;/string&gt;
      &lt;string name="edit_message"&gt;Enter a message&lt;/string&gt;
      &lt;string name="button_send"&gt;Send&lt;/string&gt;
  &lt;/resources&gt;
  </code></pre>
  
  
  
  <p>If someone can point out where it is the EditText editText = findViewById(R.id.editText); part is going wrong i would greatly appreciate it.
  Thanks :)</p>