title: Errors during the execution of android application
body: <p>I am about to create my first android app 
  :<a href="http://i.stack.imgur.com/K5lJl.png" rel="nofollow">This is a screenshot of how the app looks</a></p>
  
  <p><em>So</em> The main idea of this app is to generate random numbers in the two buttons
  and the user guess which number is bigger if he guessed it right: </p>
  
  <p>This is the XML layout
      </p>
  
  <pre><code>&lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@id/app_name"
      android:gravity="center_horizontal"
      android:text="Press the button of the larger Number.if you get it right you will earn point !if you get it wrong you'll lose a point"
      android:textSize="16sp" /&gt;
  
  &lt;LinearLayout
      android:id="@+id/linearLayout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentEnd="true"
      android:layout_alignParentRight="true"
      android:layout_centerVertical="true"
      android:orientation="horizontal"&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;Button
              android:id="@+id/left_button_number"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="0"
              android:textStyle="bold" /&gt;
  
          &lt;Button
              android:id="@+id/right_button_number"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentEnd="true"
              android:layout_alignParentRight="true"
              android:layout_alignParentTop="true"
              android:text="0"
              android:textStyle="bold" /&gt;
      &lt;/RelativeLayout&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;TextView
      android:id="@+id/textView"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_centerHorizontal="true"
      android:layout_gravity="top"
      android:layout_marginBottom="57dp"
      android:gravity="center_horizontal"
      android:text="points : "
      android:textStyle="italic" /&gt;
  
  &lt;TextView
      android:id="@+id/score_text_view"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignTop="@+id/textView"
      android:layout_toEndOf="@+id/textView"
      android:layout_toRightOf="@+id/textView"
      android:text="0" /&gt;
  
  &lt;Button
      android:id="@+id/reset_button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/linearLayout"
      android:layout_centerHorizontal="true"
      android:text="Reset" /&gt;
  </code></pre>
  
  <p>This is the Java Code</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  int leftNumber;
  int rightNumber;
  private OnClickListener ButtonClickListener = new OnClickListener() {
      public void onClick(View v) {
          switch (v.getId()) {
              case R.id.left_button_number:
                  if (rightNumber &lt; leftNumber)
                      updateTheScore(1);
                  else
                      updateTheScore(-1);
                  break;
              case R.id.right_button_number:
                  if (rightNumber &gt; leftNumber)
                      updateTheScore(1);
                  else
                      updateTheScore(-1);
  
                  break;
              case R.id.reset_button:
                  resetTheScore();
                  break;
              default:
                  break;
          }
  
      }
  };
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
  
      numberGenerator();
      Button rightButton = (Button) findViewById(R.id.right_button_number);
      Button leftButton = (Button) findViewById(R.id.left_button_number);
      Button resetButton = (Button) findViewById(R.id.reset_button);
      rightButton.setOnClickListener(ButtonClickListener);
      leftButton.setOnClickListener(ButtonClickListener);
      resetButton.setOnClickListener(ButtonClickListener);
  
  
      FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
      fab.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                      .setAction("Action", null).show();
          }
      });
  }
  
  public void updateTheScore(int n) {
      TextView scoreView = (TextView) findViewById(R.id.score_text_view);
      int score = Integer.parseInt(scoreView.getText().toString());
      score += n;
      scoreView.setText(score);
      numberGenerator();
  }
  
  public void resetTheScore() {
      TextView scoreView = (TextView) findViewById(R.id.score_text_view);
      scoreView.setText(0);
      numberGenerator();
  }
  
  public void numberGenerator() {
      int min = 1;
      int max = 100;
      Random r = new Random();
      leftNumber = r.nextInt(max - min + 1) + min;
      rightNumber = r.nextInt(max - min + 1) + min;
      displayMessageOnButton(leftNumber, rightNumber);
  }
  
  public void displayMessageOnButton(int left, int right) {
      Button rightButton = (Button) findViewById(R.id.right_button_number);
      Button leftButton = (Button) findViewById(R.id.left_button_number);
      rightButton.setText(right);
      leftButton.setText(left);
  }
  </code></pre>
  
  <p>This is the logcat</p>
  
  <pre><code> String resource ID #0x4a
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2194)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
                                                                           at android.app.ActivityThread.access$600(ActivityThread.java:139)
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                           at android.os.Looper.loop(Looper.java:154)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:4945)
                                                                           at java.lang.reflect.Method.invokeNative(Native Method)
                                                                           at java.lang.reflect.Method.invoke(Method.java:511)
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
                                                                           at dalvik.system.NativeStart.main(Native Method)
                                                                        Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x4a
                                                                           at android.content.res.Resources.getText(Resources.java:266)
                                                                           at android.widget.TextView.setText(TextView.java:3627)
                                                                           at com.example.android.big.MainActivity.displayMessageOnButton(MainActivity.java:87)
                                                                           at com.example.android.big.MainActivity.numberGenerator(MainActivity.java:81)
                                                                           at com.example.android.big.MainActivity.onCreate(MainActivity.java:39)
                                                                           at android.app.Activity.performCreate(Activity.java:4531)
                                                                           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2150)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229) 
                                                                           at android.app.ActivityThread.access$600(ActivityThread.java:139) 
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261) 
                                                                           at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                           at android.os.Looper.loop(Looper.java:154) 
                                                                           at android.app.ActivityThread.main(ActivityThread.java:4945) 
                                                                           at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                           at java.lang.reflect.Method.invoke(Method.java:511) 
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 
                                                                           at dalvik.system.NativeStart.main(Native Method) 
  </code></pre>