title: EditText Android, [new to android]
body: <p>What I plan to make is, make an empty EditText and when the Players or Users Typed my answer word/numbers it will automatically say "Correct" and it will not react to anything else,
  it is named "test" because, once I get it working I'm gonna use the code for the little guessing game I'm gonna create :)</p>
  
  <p>here is the java.</p>
  
  <pre><code>package com.example.test;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.widget.EditText;
  import android.widget.Toast;
  
  public class MainActivity extends Activity  {
      EditText who;
      String name = "";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main); 
          name = who.getText().toString();
          if(name.matches("rumia"));   
          Toast.makeText(this, "Correct", Toast.LENGTH_SHORT).show();
      }
  }
  </code></pre>
  
  <p>here's the XML </p>
  
  <pre><code>    &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/RelativeLayout1"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" 
      android:background="@android:color/black"&gt;
  
      &lt;EditText
          android:id="@+id/who"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_alignParentRight="true"
          android:ems="10"
          android:background="@android:color/white"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I tried various thing to make it to work (e.g. Just plain XML without designs(backgrounds/images))but can't get it to work.. still saying Unfortunately test has stopped..</p>
  
  <p>Here's the Logcat</p>
  
  <pre><code>09-28 00:18:42.106: E/AndroidRuntime(3250): Process: com.example.test, PID: 3250
  09-28 00:18:42.106: E/AndroidRuntime(3250): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:18:42.106: E/AndroidRuntime(3250):     at com.example.test.MainActivity.onCreate(MainActivity.java:20)
  09-28 00:18:50.806: E/WindowManager(372): Starting window AppWindowToken{b523b308 token=Token{b4f45670 ActivityRecord{b4f7af58 u0 com.example.test/.MainActivity t4}}} timed out
  09-28 00:20:10.586: E/AndroidRuntime(3311): Process: com.example.test, PID: 3311
  09-28 00:20:10.586: E/AndroidRuntime(3311): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:20:10.586: E/AndroidRuntime(3311):     at com.example.test.MainActivity.&lt;init&gt;(MainActivity.java:23)
  09-28 00:20:19.296: E/WindowManager(372): Starting window AppWindowToken{b525be10 token=Token{b5006af8 ActivityRecord{b5016630 u0 com.example.test/.MainActivity t5}}} timed out
  09-28 00:24:07.836: E/AndroidRuntime(3361): Process: com.example.test, PID: 3361
  09-28 00:24:07.836: E/AndroidRuntime(3361): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.test/com.example.test.MainActivity}:  java.lang.NullPointerException
  09-28 00:24:07.836: E/AndroidRuntime(3361):     at com.example.test.MainActivity.&lt;init&gt;(MainActivity.java:21)
  09-28 00:24:16.826: E/WindowManager(372): Starting window AppWindowToken{b526fe78 token=Token{b4f9d330 ActivityRecord{b4d98c78 u0 com.example.test/.MainActivity t6}}} timed out
  09-28 00:28:19.376: E/AndroidRuntime(3407): Process: com.example.test, PID: 3407
  09-28 00:28:19.376: E/AndroidRuntime(3407): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:28:19.376: E/AndroidRuntime(3407):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:28:27.876: E/WindowManager(372): Starting window AppWindowToken{b5250f38 token=Token{b4e1ed28 ActivityRecord{b4ff97f8 u0 com.example.test/.MainActivity t7}}} timed out
  09-28 00:31:57.366: E/AndroidRuntime(3454): Process: com.example.test, PID: 3454
  09-28 00:31:57.366: E/AndroidRuntime(3454): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:31:57.366: E/AndroidRuntime(3454):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:32:06.026: E/WindowManager(372): Starting window AppWindowToken{b5276900 token=Token{b5225168 ActivityRecord{b4f8f4a8 u0 com.example.test/.MainActivity t8}}} timed out
  09-28 00:33:25.616: E/AndroidRuntime(3500): Process: com.example.test, PID: 3500
  09-28 00:33:25.616: E/AndroidRuntime(3500): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:33:25.616: E/AndroidRuntime(3500):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:33:34.496: E/WindowManager(372): Starting window AppWindowToken{b5257c88 token=Token{b52659a0 ActivityRecord{b4ff97f8 u0 com.example.test/.MainActivity t9}}} timed out
  09-28 00:36:09.836: E/AndroidRuntime(3547): Process: com.example.test, PID: 3547
  09-28 00:36:09.836: E/AndroidRuntime(3547): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:36:09.836: E/AndroidRuntime(3547):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:36:18.316: E/WindowManager(372): Starting window AppWindowToken{b525c520 token=Token{b5244b60 ActivityRecord{b5016630 u0 com.example.test/.MainActivity t10}}} timed out
  09-28 00:42:10.286: E/AndroidRuntime(3583): Process: com.example.test, PID: 3583
  09-28 00:42:10.286: E/AndroidRuntime(3583): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:42:10.286: E/AndroidRuntime(3583):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:44:05.186: E/AndroidRuntime(3629): Process: com.example.test, PID: 3629
  09-28 00:44:05.186: E/AndroidRuntime(3629): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:44:05.186: E/AndroidRuntime(3629):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:44:13.996: E/WindowManager(372): Starting window AppWindowToken{b522efa0 token=Token{b51cc708 ActivityRecord{b5104bb8 u0 com.example.test/.MainActivity t12}}} timed out
  09-28 00:44:56.576: E/AndroidRuntime(3676): Process: com.example.test, PID: 3676
  09-28 00:44:56.576: E/AndroidRuntime(3676): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:44:56.576: E/AndroidRuntime(3676):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:45:05.136: E/WindowManager(372): Starting window AppWindowToken{b51c3570 token=Token{b4ff9098 ActivityRecord{b4ff88a0 u0 com.example.test/.MainActivity t13}}} timed out
  09-28 00:49:34.606: E/AndroidRuntime(3722): Process: com.example.test, PID: 3722
  09-28 00:49:34.606: E/AndroidRuntime(3722): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:49:34.606: E/AndroidRuntime(3722):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:49:43.276: E/WindowManager(372): Starting window AppWindowToken{b5257c88 token=Token{b51dda88 ActivityRecord{b502c6c0 u0 com.example.test/.MainActivity t14}}} timed out
  09-28 00:52:00.506: E/AndroidRuntime(3770): Process: com.example.test, PID: 3770
  09-28 00:52:00.506: E/AndroidRuntime(3770): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:52:00.506: E/AndroidRuntime(3770):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:52:09.396: E/WindowManager(372): Starting window AppWindowToken{b5270b48 token=Token{b4e77b28 ActivityRecord{b4ff88a0 u0 com.example.test/.MainActivity t15}}} timed out
  09-28 00:53:46.216: E/AndroidRuntime(3817): Process: com.example.test, PID: 3817
  09-28 00:53:46.216: E/AndroidRuntime(3817): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:53:46.216: E/AndroidRuntime(3817):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:53:55.206: E/WindowManager(372): Starting window AppWindowToken{b52681d8        token=Token{b4f93ed0 ActivityRecord{b5029f80 u0 com.example.test/.MainActivity t16}}} timed out
  09-28 00:55:21.036: E/AndroidRuntime(3865): Process: com.example.test, PID: 3865
  09-28 00:55:21.036: E/AndroidRuntime(3865): java.lang.RuntimeException: Unable to start activity  ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.NullPointerException
  09-28 00:55:21.036: E/AndroidRuntime(3865):     at com.example.test.MainActivity.onCreate(MainActivity.java:17)
  09-28 00:55:30.136: E/WindowManager(372): Starting window AppWindowToken{b5257c88 token=Token{b4f72f20 ActivityRecord{b4ff88a0 u0 com.example.test/.MainActivity t17}}} timed out
  </code></pre>