title: Problem in starting tab activity on button click
body: <p>I have gone through links on stackover flow on starting new tab activity on button click.</p>
  
  <p>I am getting following on logcat :</p>
  
  <pre><code>07-30 13:08:10.460: ERROR/AndroidRuntime(304): FATAL EXCEPTION: main
  07-30 13:08:10.460: ERROR/AndroidRuntime(304): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.biz.mlm/com.biz.mlm.HomeTabActivity}: java.lang.NullPointerException
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at android.os.Handler.dispatchMessage(Handler.java:99)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at android.os.Looper.loop(Looper.java:123)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at java.lang.reflect.Method.invoke(Method.java:521)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at dalvik.system.NativeStart.main(Native Method)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304): Caused by: java.lang.NullPointerException
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at com.biz.mlm.HomeTabActivity.onCreate(HomeTabActivity.java:28)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  07-30 13:08:10.460: ERROR/AndroidRuntime(304):     ... 11 more
  07-30 13:08:10.520: WARN/ActivityManager(58):   Force finishing activity com.biz.mlm/.HomeTabActivity
  07-30 13:08:10.520: WARN/ActivityManager(58):   Force finishing activity com.biz.mlm/.login
  </code></pre>
  
  <p>I am trying to start HomeTabActivity on click of login button as :</p>
  
  <pre><code>Intent newIntent = new Intent(
                                      getApplicationContext(), HomeTabActivity.class);
                              newIntent.putExtra("Userid", message);
                              newIntent.putExtra("Password", txtPswrd.getText()
                                      .toString());
                              startActivity(newIntent);
  </code></pre>
  
  <p>Also I have added three different activities changePassword,editprofile and homeActivity on homeTabActivity.</p>
  
  <p>the code for my homeTabActivity.java is</p>
  
  <pre><code>TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);  // The activity TabHost
          TabHost.TabSpec spec;  // Reusable TabSpec for each tab
          Intent intent;  // Reusable Intent for each tab
  
          // Create an Intent to launch an Activity for the tab (to be reused)
          intent = new Intent().setClass(this,HomeActivity.class);
  
          // Initialize a TabSpec for each tab and add it to the TabHost
          spec = tabHost.newTabSpec("Home").setIndicator("Home").setContent(intent);
          tabHost.addTab(spec);
  
          // Do the same for the other tabs
          intent = new Intent().setClass(this, changePasswordActivity.class);
          spec = tabHost.newTabSpec("Change Password").setIndicator("Change Password").setContent(intent);
          tabHost.addTab(spec);
  
          intent = new Intent().setClass(this, editProfileActivity.class);
          spec = tabHost.newTabSpec("Edit Profile").setIndicator("Edit Profile").setContent(intent);
          tabHost.addTab(spec);
  
          tabHost.setCurrentTab(2);
  </code></pre>
  
  <p>and the code segment i added for this in manifest file is :</p>
  
  <pre><code>&lt;activity android:name=".HomeTabActivity" android:label="Home"
              android:theme="@android:style/Theme.NoTitleBar" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".HomeActivity"&gt;
          &lt;intent-filter&gt;
                  &lt;action android:name="com.biz.mlm.HomeActivity" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".editProfileActivity"&gt;
          &lt;intent-filter&gt;
                  &lt;action android:name="com.biz.mlm.editProfileActivity" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".changePasswordActivity"&gt;
          &lt;intent-filter&gt;
                  &lt;action android:name="com.biz.mlm.changePasswordActivity" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  </code></pre>