title: onClick crash (issue solved by converting int into String before using it with setText())
body: <p>I was trying to build a very simple game where you have to click the buttons that pop (1 is pop and 0 is not pop) as fast as you can in one minute (to get the highest number of whacks possible in that timeframe). I am able to start my app and start the counter by clicking on the "start" button, but when I click on the button with a "1" the app crashes. Do you have an idea of why?</p>
  
  <p>Thank you very much for your time!</p>
  
  <p>This is my code:</p>
  
  <p>MainActivity.java</p>
  
  <pre><code>package com.example.android.whack_a_lock_022;
  
  import android.os.Bundle;
  import android.os.CountDownTimer;
  import android.support.v7.app.AppCompatActivity;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  
  import java.util.Random;
  
  public class MainActivity extends AppCompatActivity {
  
      int cl = 0;
      int nl = 0;
      int sl = 0;
      int whacks = 0;
      int maxwhacks = 0;
      Random r;
      float random0to1;
      private CountDownTimer countDownTimer;
      private Button start;
      private Button cancel;
      private TextView time;
  
      public float numAlea() {
          return r.nextFloat();
      }
  
      private View.OnClickListener btnClickListener = new View.OnClickListener () {
          @Override
          public void onClick(View v) {
              switch(v.getId()) {
                  case R.id.startButton :
                      start();
                      break;
                  case R.id.cancelButton :
                      cancel();
                      break;
              }
          }
      };
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          r = new Random();
  
          // Capture our button from layout
          start = (Button) findViewById(R.id.startButton);
          start.setOnClickListener(btnClickListener);
          cancel = (Button) findViewById(R.id.cancelButton);
          cancel.setOnClickListener(btnClickListener);
          time = (TextView) findViewById(R.id.time);
          Button clButton = findViewById(R.id.cl);
          Button nlButton = findViewById(R.id.nl);
          Button slButton = findViewById(R.id.sl);
  
          // Register the onClick listener with the implementation above
  
          clButton.setOnClickListener (new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if (cl == 1) {
                      cl = 0;
                      TextView CapsLock = findViewById(R.id.cl);
                      CapsLock.setText("0");
                      whacks++;
                      TextView NumberOfWhacks = findViewById(R.id.numberOfWhacksView);
                      NumberOfWhacks.setText(whacks);
                      if (whacks &gt; maxwhacks) {
                          maxwhacks = whacks;
                          TextView NumberOfMaxWhacks = findViewById(R.id.numberOfMaxWhacksView);
                          NumberOfMaxWhacks.setText(maxwhacks);
                      }
  
                      pop();
                  }
              }
          });
  
          nlButton.setOnClickListener (new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if (nl == 1) {
                      nl = 0;
                      TextView NumLock = findViewById(R.id.nl);
                      NumLock.setText("0");
                      whacks++;
                      TextView NumberOfWhacks = findViewById(R.id.numberOfWhacksView);
                      NumberOfWhacks.setText(whacks);
                      if (whacks &gt; maxwhacks) {
                          maxwhacks = whacks;
                          TextView NumberOfMaxWhacks = findViewById(R.id.numberOfMaxWhacksView);
                          NumberOfMaxWhacks.setText(maxwhacks);
                      }
  
                      pop();
                  }
              }
          });
  
          slButton.setOnClickListener (new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if (sl == 1) {
                      sl = 0;
                      TextView ScrollLock = findViewById(R.id.sl);
                      ScrollLock.setText("0");
                      whacks++;
                      TextView NumberOfWhacks = findViewById(R.id.numberOfWhacksView);
                      NumberOfWhacks.setText(whacks);
                      if (whacks &gt; maxwhacks) {
                          maxwhacks = whacks;
                          TextView NumberOfMaxWhacks = findViewById(R.id.numberOfMaxWhacksView);
                          NumberOfMaxWhacks.setText(maxwhacks);
                      }
  
                      pop();
                  }
              }
          });
      }
  
      private void start () {
  
          time.setText("60");
  
          countDownTimer = new CountDownTimer(60 * 1000, 1000) {
              @Override
              public void onTick(long millisUntilFinished) {
                  time.setText("" + millisUntilFinished / 1000);
              }
  
              @Override
              public void onFinish(){
                  time.setText("Done !");
              }
          };
          countDownTimer.start();
  
          pop();
  
      }
  
      private void pop(){
          // Escolhe e "POPa" o botão
  
          // Gera número aleatório
          random0to1 = numAlea();
  
          if (random0to1 &lt;= (1 / 3)) {
  
              cl = 1;
              Button clButton = (Button) findViewById(R.id.cl);
              clButton.setText("1");
  
          } else if (random0to1 &lt;= 2 / 3) {
              nl = 1;
              Button nlButton = (Button) findViewById(R.id.nl);
              nlButton.setText("1");
          } else if (random0to1 &lt;= 1) {
              sl = 1;
              Button slButton = (Button) findViewById(R.id.sl);
              slButton.setText("1");
          }
      }
  
      private void cancel() {
          if (countDownTimer != null) {
              countDownTimer.cancel();
              countDownTimer = null;
          }
  
          //Põe botões a zeros
  
          cl = 0;
          Button clButton = (Button) findViewById(R.id.cl);
          clButton.setText("0");
  
          nl = 0;
          Button nlButton = (Button) findViewById(R.id.nl);
          nlButton.setText("0");
  
          sl = 0;
          Button slButton = (Button) findViewById(R.id.sl);
          slButton.setText("0");
  
          whacks = 0;
          TextView NumberOfWhacks = findViewById(R.id.numberOfWhacksView);
          NumberOfWhacks.setText("0");
  
      }
  
  }
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout 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"
      android:orientation="vertical"
      tools:context=".MainActivity"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"&gt;
          &lt;TextView
              android:id="@+id/whacksView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:text="WHACKS"
              android:textSize="24sp"
              android:textAlignment="center"/&gt;
          &lt;TextView
              android:id="@+id/maxWhacksView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textAlignment="center"
              android:text="MAX WHACKS"
              android:layout_weight="1"
              android:textSize="24sp"/&gt;
      &lt;/LinearLayout&gt;
  
      &lt;TextView
          android:id="@+id/time"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textAlignment="center"
          android:text="60"
          android:textSize="24sp"/&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"&gt;
          &lt;TextView
              android:id="@+id/numberOfWhacksView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:text="0"
              android:textAlignment="center"
              android:textSize="24sp"/&gt;
          &lt;TextView
              android:id="@+id/numberOfMaxWhacksView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textAlignment="center"
              android:text="0"
              android:layout_weight="1"
              android:textSize="24sp"/&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"&gt;
          &lt;Button
              android:id="@+id/cl"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="0"
              android:layout_weight="1"/&gt;
          &lt;Button
              android:id="@+id/nl"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="0"
              android:layout_weight="1"/&gt;
          &lt;Button
              android:id="@+id/sl"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="0"
              android:layout_weight="1"/&gt;
      &lt;/LinearLayout&gt;
  
      &lt;Button
          android:id="@+id/startButton"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:text="Start" /&gt;
  
      &lt;Button
          android:id="@+id/cancelButton"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:text="Cancel" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Crashes with:</p>
  
  <pre><code>09-06 12:45:53.364 13767-13767/com.example.android.whack_a_lock_022 E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.android.whack_a_lock_022, PID: 13767
      android.content.res.Resources$NotFoundException: String resource ID #0x1
          at android.content.res.Resources.getText(Resources.java:335)
          at android.widget.TextView.setText(TextView.java:4555)
          at com.example.android.whack_a_lock_022.MainActivity$4.onClick(MainActivity.java:114)
          at android.view.View.performClick(View.java:5637)
          at android.view.View$PerformClick.run(View.java:22429)
          at android.os.Handler.handleCallback(Handler.java:751)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:154)
          at android.app.ActivityThread.main(ActivityThread.java:6119)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
  </code></pre>