title: App stops working when pressing a button
body: <p>So I am starting with app programming and I am trying to program my first test app.
  The main pupose of the app is that it acts like a dice and gives a random number between 1 and 6. However when I push the roll button the app crashes</p>
  
  <p>My <code>mainActivity</code> code is as follows:</p>
  
  <pre class="lang-java prettyprint-override"><code>package com.example.second;
  
  import java.util.Random;
  
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.EditText;
  
  
  public class MainActivity extends ActionBarActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  public void roll(View v){
      int min = 1;
      int max = 7;
  
      Random r = new Random();
      int i1 = r.nextInt(max - min + 1) + min;
      EditText random = (EditText)findViewById(R.id.randomtxt);
      random.setText(i1);
  
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
      if (id == R.id.action_settings) {
          return true;
      }
      return super.onOptionsItemSelected(item);
   }
  }
  </code></pre>
  
  <p>And the .xml code is </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context="com.example.second.MainActivity" &gt;
  
  &lt;Button
      android:id="@+id/roll"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:layout_marginLeft="106dp"
      android:layout_marginTop="124dp"
      android:onClick="roll"
      android:text="@string/roll" /&gt;
  
  &lt;TextView
      android:id="@+id/randomtxt"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/roll"
      android:layout_alignParentTop="true"
      android:layout_alignRight="@+id/roll"
      android:layout_marginTop="48dp"
      android:text="@string/num1"
      android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
     &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The error that I get is <code>Emulator] setWindowSurfaceColorBuffer: bad color buffer handle 0</code>, but I do not think this has anything to do with the crashing off the app.</p>
  
  <p>And because I cannot find any problems (nor does SDK provide any) I have no idea why my app crashes.</p>