not able to get value from edittext
<p>I've the following code.</p>

<pre><code>final Button Submit= (Button) findViewById(R.id.SubmitButton);
            Submit.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {

                chatbox=(EditText)findViewById(R.id.Chatbox);   &lt;-- error
                String data=chatbox.getText().toString();
                Log.i("chama",data);

                HashMap&lt;String,String&gt; hashMap=new HashMap&lt;String,String&gt;();    
                        hashMap.put("You",chatbox.getText().toString());    //insert username(You) value in chatbox to hashmap

                        adminChat.add(hashMap);                                 //insert hashMap in arraylist
                        ShowListView(adminChat);                            //pass it to listview

                        sendHttpRequest("set", "admin", "You" ,chatbox.getText().toString(),clientEmail,UserAdminChatActivity.LastShowingChatDate);                   

         }});
</code></pre>

<p>It is declared in the xml like this </p>

<pre><code>&lt;EditText
    android:id="@+id/Chatbox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@id/SubmitButton"
    android:layout_alignBottom="@id/SubmitButton"
    android:layout_alignParentLeft="true"
    android:layout_toLeftOf="@id/SubmitButton"
    android:ems="10"
    android:inputType="text" &gt;
&lt;/EditText&gt;
</code></pre>

<p>The logcat gives the following error:</p>

<pre><code>07-15 17:40:20.083: E/AndroidRuntime(5503): FATAL EXCEPTION: main
07-15 17:40:20.083: E/AndroidRuntime(5503): java.lang.NullPointerException
07-15 17:40:20.083: E/AndroidRuntime(5503):     at com.app.ServerClient.UserAdminChatActivity$2.onClick(UserAdminChatActivity.java:52)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at android.view.View.performClick(View.java:2485)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at android.view.View$PerformClick.run(View.java:9080)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at android.os.Handler.handleCallback(Handler.java:587)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at android.os.Handler.dispatchMessage(Handler.java:92)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at android.os.Looper.loop(Looper.java:123)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at android.app.ActivityThread.main(ActivityThread.java:3647)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at java.lang.reflect.Method.invokeNative(Native Method)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at java.lang.reflect.Method.invoke(Method.java:507)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-15 17:40:20.083: E/AndroidRuntime(5503):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>
