title: Google Sign In for Android: Cannot resolve RC_SIGN_IN
body: <p>I'm trying to authenticate with backend server from mobile app.
  I was following this documentation. <a href="https://developers.google.com/identity/sign-in/android/sign-in" rel="noreferrer">https://developers.google.com/identity/sign-in/android/sign-in</a>
  However, there are some errors. <code>RC_SIGN_IN</code> and <code>updateUI()</code> cannot be resolved.</p>
  
  <p>My code is like this</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
      ...
  
         GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
              .requestEmail()
              .build();
  
         mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
  
          mSignInButton = findViewById(R.id.sign_in_button);
          mSignInButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Toast.makeText(MainActivity.this, "Hello", Toast.LENGTH_LONG).show();
              Intent signIntent = mGoogleSignInClient.getSignInIntent();
              startActivityForResult(signIntent, RC_SIGN_IN);
          }
      });
  
  
     @Override
     protected void onStart() {
          GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);
          updateUI(account);
          super.onStart();
      }
  
  
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      // Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...);
      if (requestCode == RC_SIGN_IN) {
          // The Task returned from this call is always completed, no need to attach
          // a listener.
          Task&lt;GoogleSignInAccount&gt; task = GoogleSignIn.getSignedInAccountFromIntent(data);
          handleSignInResult(task);
      }
  }
  
  
     private void handleSignInResult(Task&lt;GoogleSignInAccount&gt; completedTask) {
         try {
             GoogleSignInAccount account = completedTask.getResult(ApiException.class);
             String idToken = account.getIdToken();
  
             // Send Id Token to the backend and validate here
  
             // Signed in successfully, show authenticated UI.
             updateUI(account);
         } catch (ApiException e) {
             // The ApiException status code indicates the detailed failure reason.
             // Please refer to the GoogleSignInStatusCodes class reference for more information.
             Log.w(TAG, "signInResult:failed code=" + e.getStatusCode());
             updateUI(null);
         }
     }
  </code></pre>
  
  <h1>Update</h1>
  
  <p>Now the button itself doesn't work.</p>
  
  <p><code>xml</code></p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/drawer_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fitsSystemWindows="true"&gt;
  
  &lt;!-- Include the main content --&gt;
  &lt;FrameLayout
      android:id="@+id/content_frame"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  
      &lt;com.google.android.gms.common.SignInButton
          android:id="@+id/sign_in_button"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" /&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;TextView
              android:id="@+id/text_view_result"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textColor="#000"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintLeft_toLeftOf="parent"
              app:layout_constraintRight_toRightOf="parent"
              app:layout_constraintTop_toTopOf="parent" /&gt;
  
      &lt;/android.support.v4.widget.NestedScrollView&gt;
  
  &lt;/FrameLayout&gt;
  
  &lt;!-- Navigation bar --&gt;
  &lt;android.support.design.widget.NavigationView
      android:id="@+id/nav_view"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:fitsSystemWindows="true"
      app:menu="@menu/navigation_menu"/&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>How can I fix this?</p>