```
    public class screen2 extends Activity {

        @Override
        public void onCreate(Bundle savedInstanceState) {

            super.onCreate(savedInstanceState);
            setContentView(R.layout.screen2);

            final Button button1 = (Button)findViewById(R.id.button1);        
            button1.setOnClickListener(new View.OnClickListener() {
                 public void onClick(View v) {

                    //AInteger.parseInt(string)
                    System.out.println("1");
                    EditText et = (EditText)findViewById(R.id.editText1);
                    System.out.println("2");
                    int zipCode =  Integer.parseInt(et.getText().toString());
                    System.out.println("3");
                    System.out.println(zipCode);

                    System.out.println("dude...5");
                 }
            });
        }        
   }

```

This code shows the errror in the logcat : 

```
    11-13 19:58:06.806: W/KeyCharacterMap(281): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
11-13 19:58:09.471: I/System.out(281): 1
11-13 19:58:09.471: I/System.out(281): 2
11-13 19:58:09.477: D/AndroidRuntime(281): Shutting down VM
11-13 19:58:09.477: W/dalvikvm(281): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
11-13 19:58:09.527: E/AndroidRuntime(281): FATAL EXCEPTION: main
11-13 19:58:09.527: E/AndroidRuntime(281): java.lang.NullPointerException
11-13 19:58:09.527: E/AndroidRuntime(281):  at com.example.andtwi.screen2$1.onClick(screen2.java:23)
11-13 19:58:09.527: E/AndroidRuntime(281):  at android.view.View.performClick(View.java:2408)
11-13 19:58:09.527: E/AndroidRuntime(281):  at android.view.View$PerformClick.run(View.java:8816)
11-13 19:58:09.527: E/AndroidRuntime(281):  at android.os.Handler.handleCallback(Handler.java:587)
11-13 19:58:09.527: E/AndroidRuntime(281):  at android.os.Handler.dispatchMessage(Handler.java:92)
11-13 19:58:09.527: E/AndroidRuntime(281):  at android.os.Looper.loop(Looper.java:123)
11-13 19:58:09.527: E/AndroidRuntime(281):  at android.app.ActivityThread.main(ActivityThread.java:4627)
11-13 19:58:09.527: E/AndroidRuntime(281):  at java.lang.reflect.Method.invokeNative(Native Method)
11-13 19:58:09.527: E/AndroidRuntime(281):  at java.lang.reflect.Method.invoke(Method.java:521)
11-13 19:58:09.527: E/AndroidRuntime(281):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-13 19:58:09.527: E/AndroidRuntime(281):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-13 19:58:09.527: E/AndroidRuntime(281):  at dalvik.system.NativeStart.main(Native Method)

```

Though it looks like an Null Pointer exception , i think i am doing it things exactly i found on forums. Here is code of my related xml file as well. Can anyone suggest where am i doing it wrong?

```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Enter Zipcode" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="number"
        android:maxLength="5" >

        <requestFocus />
    </EditText>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Get movies from Flixster" />

</LinearLayout>

```

The code breaks at this as well : 

```
int zipCode =  Integer.parseInt(et.getText().toString());

```