title: Unfortunately App has stopped, while trying to add Tabs
body: <p>I have written an app in which i am fetching list of facebook friends, but now i have decided to add one more feature in my existing app - Multiple Tabs,</p>
  
  <p>and i have also written necessary code to get that, but whenever i Run my program getting - Unfortunately App has stopped</p>
  
  <p>I guess the below line is creating problem, but not getting a way how can i remove this issue?</p>
  
  <pre><code>this.setDisplayShowIconEnabled(false);
  </code></pre>
  
  <p><em>ActionBarActivity.java:</em></p>
  
  <pre><code>  protected void setDisplayShowIconEnabled(boolean bool) {
      mActionBarHelper.setDisplayShowIconEnabled(bool);
  }
  </code></pre>
  
  <p><em>ActionBarHelperICS.java:</em></p>
  
  <pre><code>     @Override
  public void setDisplayShowIconEnabled(boolean bool) {
      mActivity.getActionBar().setDisplayShowHomeEnabled(bool);
  }
  </code></pre>
  
  <p><em>SplashScreen.java:</em></p>
  
  <pre><code>  public void onRequestReceived(int result, String message) {
      Log.d(LOG_TAG, "onRequestReceived(" + result + ")");
      if(isFinishing())
          return;
      switch (result) {
      case FacebookRequest.COMPLETED:
          Intent intent = new Intent(this, Main.class);
          intent.putExtra("FRIENDS", message);
          while (System.currentTimeMillis() - startTime &lt; DELAY) {
              try { Thread.sleep(50); } catch (Exception e) {}
          }
          startActivityForResult(intent, FRIENDS_LIST_ACTIVITY);
          isLoadingFriends = false;
          break;
      case FacebookRequest.IO_EXCEPTION:
      case FacebookRequest.FILE_NOT_FOUND_EXCEPTION:
      case FacebookRequest.MALFORMED_URL_EXCEPTION:
      case FacebookRequest.FACEBOOK_ERROR:
          FacebookUtility.displayMessageBox(this, this.getString(R.string.friends_error));
          onButton();
          break;
      }
  }
  </code></pre>
  
  <p><em>Main.java:</em></p>
  
  <pre><code> public class Main extends TabActivity {
  
  
  private TabHost tabHost;
  private final String FRIENDS_TAB = "friends";
  private final String MONTH_TAB = "month";
  private final String WEEK_TAB = "week";
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.main);
  
      tabHost = (TabHost) findViewById(android.R.id.tabhost);
      TabSpec contactSpec = tabHost.newTabSpec(FRIENDS_TAB).setIndicator(
              "FB Friends", getResources().getDrawable(R.drawable.friends))
              .setContent(new Intent(Main.this, FriendsList.class));
  
      TabSpec monthSpec = tabHost.newTabSpec(MONTH_TAB).setIndicator(
              "This Month", getResources().getDrawable(R.drawable.month))
              .setContent(new Intent(Main.this, FriendsList.class));
  
      TabSpec weekSpec = tabHost.newTabSpec(WEEK_TAB).setIndicator(
              "This Week", getResources().getDrawable(R.drawable.week))
              .setContent(new Intent(Main.this, FriendsList.class));
  
  
      tabHost.addTab(contactSpec);
      tabHost.addTab(monthSpec);
      tabHost.addTab(weekSpec);
  
      tabHost.setCurrentTab(0);
  
  }
    }
  </code></pre>
  
  <p><em>FriendsList.java:</em></p>
  
  <pre><code>   public class FriendsList extends ActionBarActivity  implements FacebookRequest, OnItemClickListener {
  private static String LOG_TAG = "FriendsList";
  private static JSONArray jsonArray;
  private static ListView friendsList;
  private Handler mHandler;
    private Button saveGreeting;
  @Override
  public void onCreate(Bundle savedInstanceState) {
      mHandler = new Handler();
      super.onCreate(savedInstanceState);     
      try {
          requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
      } catch (Exception e) {}
      setContentView(R.layout.friends_list_screen);
      try {
          setProgressBarIndeterminateVisibility(false);
          setProgressBarInDVisibility(false);
      } catch (Exception e) {}
     this.setDisplayShowIconEnabled(false);
      init();
  
      saveGreeting = (Button) findViewById(R.id.greeting);
      saveGreeting.setOnClickListener(new OnClickListener() {
      public void onClick(View v) {
          customGreeting(v);
          }
      });
  }
  </code></pre>
  
  <p><em>Logcat Report:</em></p>
  
  <pre><code>     01-14 16:18:02.954: E/AndroidRuntime(960): FATAL EXCEPTION: main
  01-14 16:18:02.954: E/AndroidRuntime(960): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.chr.tatu.sample.friendslist/com.chr.tatu.sample.friendslist.Main}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.chr.tatu.sample.friendslist/com.chr.tatu.sample.friendslist.FriendsList}: java.lang.NullPointerException
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.os.Handler.dispatchMessage(Handler.java:99)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.os.Looper.loop(Looper.java:137)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.ActivityThread.main(ActivityThread.java:5039)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at java.lang.reflect.Method.invokeNative(Native Method)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at java.lang.reflect.Method.invoke(Method.java:511)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at dalvik.system.NativeStart.main(Native Method)
  01-14 16:18:02.954: E/AndroidRuntime(960): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.chr.tatu.sample.friendslist/com.chr.tatu.sample.friendslist.FriendsList}: java.lang.NullPointerException
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.ActivityThread.startActivityNow(ActivityThread.java:2023)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:135)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:347)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:749)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.widget.TabHost.setCurrentTab(TabHost.java:413)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.widget.TabHost.addTab(TabHost.java:240)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at com.chr.tatu.sample.friendslist.Main.onCreate(Main.java:37)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.Activity.performCreate(Activity.java:5104)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
  01-14 16:18:02.954: E/AndroidRuntime(960):  ... 11 more
  01-14 16:18:02.954: E/AndroidRuntime(960): Caused by: java.lang.NullPointerException
  01-14 16:18:02.954: E/AndroidRuntime(960):  at com.chr.tatu.sample.friendslist.ActionBarHelperICS.setDisplayShowIconEnabled(ActionBarHelperICS.java:38)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at com.chr.tatu.sample.friendslist.ActionBarActivity.setDisplayShowIconEnabled(ActionBarActivity.java:85)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at com.chr.tatu.sample.friendslist.FriendsList.onCreate(FriendsList.java:56)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.Activity.performCreate(Activity.java:5104)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  01-14 16:18:02.954: E/AndroidRuntime(960):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
  01-14 16:18:02.954: E/AndroidRuntime(960):  ... 21 more
  </code></pre>