title: Android EditText setText not working
body: <p>I am trying to setText of edittext using java but it is not working and force closing my application, though i am not sure why</p>
  
  <p>Java Code</p>
  
  <pre><code>EditText UserProfileFirstName;
  UserProfileFirstName = (EditText) findViewById(R.id.userFirstName);
  UserProfileFirstName.setText("John");
  </code></pre>
  
  <p>Xml</p>
  
  <pre><code>&lt;EditText 
     android:id="@+id/userFirstName"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:inputType="text"
     android:textSize="22sp"
     android:layout_marginTop="40dp"
     android:layout_marginBottom="15dp"
     android:hint="First Name"
     android:ems="10"
    /&gt;
  </code></pre>
  
  <p>LogCat Error</p>
  
  <pre><code>        01-23 09:32:15.564: E/AndroidRuntime(4101): FATAL EXCEPTION: main
          01-23 09:32:15.564: E/AndroidRuntime(4101): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.unext.unextlibrary/com.unext.unextlibrary.ProfileActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.unext.unextlibrary/com.unext.unextlibrary.UserProfile}: java.lang.NullPointerException
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.os.Handler.dispatchMessage(Handler.java:99)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.os.Looper.loop(Looper.java:137)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.ActivityThread.main(ActivityThread.java:5039)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at java.lang.reflect.Method.invokeNative(Native Method)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at java.lang.reflect.Method.invoke(Method.java:511)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at dalvik.system.NativeStart.main(Native Method)
          01-23 09:32:15.564: E/AndroidRuntime(4101): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.unext.unextlibrary/com.unext.unextlibrary.UserProfile}: java.lang.NullPointerException
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:2023)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:135)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:347)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:749)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.widget.TabHost.setCurrentTab(TabHost.java:413)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.widget.TabHost.addTab(TabHost.java:240)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at com.unext.unextlibrary.ProfileActivity.onCreate(ProfileActivity.java:105)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.Activity.performCreate(Activity.java:5104)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     ... 11 more
          01-23 09:32:15.564: E/AndroidRuntime(4101): Caused by: java.lang.NullPointerException
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at com.unext.unextlibrary.UserProfile.onCreate(UserProfile.java:57)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.Activity.performCreate(Activity.java:5104)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
          01-23 09:32:15.564: E/AndroidRuntime(4101):     ... 21 more
  </code></pre>
  
  <p>I searched on google and also saw SO answers but nothing seems to be working for me</p>