title: ActionBar error "incompatible types"
body: <p>I am stuck with making tabs using ActionBar. When I make it to run app with some code changes, my app crashes instantly without even starting. The current code is closest to working where I could get. This is MainActivity here:</p>
  
  <pre><code>import android.app.FragmentTransaction;
  import android.support.v4.view.ViewPager;
  import android.os.Bundle;
  import android.view.Menu;
  import android.support.v4.app.FragmentActivity;
  import android.support.v7.app.ActionBar.Tab;
  import android.app.ActionBar;
  
  public class MainActivity extends FragmentActivity implements ActionBar.TabListener {
  
      ActionBar actionbar;
      ViewPager viewpager;
      FragmentPageAdapter ft;
      FragmentPageAdapter mAdapter;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          viewpager = (ViewPager) findViewById(R.id.pager);
          ft = new FragmentPageAdapter(getSupportFragmentManager());
          mAdapter = new FragmentPageAdapter(getSupportFragmentManager());
          //final ActionBar actionBar = getActionBar();
          //final ActionBar actionBar = getSupportActionBar();
  
          actionbar = getActionBar();
  
          viewpager.setAdapter(ft);
          actionbar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
          actionbar.addTab(actionbar.newTab().setText("DotNet").setTabListener(this));
          actionbar.addTab(actionbar.newTab().setText("Eal").setTabListener(this));
          actionbar.addTab(actionbar.newTab().setText("Neowin").setTabListener(this));
          actionbar.addTab(actionbar.newTab().setText("PcWorld").setTabListener(this));
          viewpager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
              @Override
              public void onPageSelected(int arg0) {
                  actionbar.setSelectedNavigationItem(arg0);
              }
              @Override
              public void onPageScrolled(int arg0, float arg1, int arg2) {
                  // TODO Auto-generated method stub
              }
              @Override
              public void onPageScrollStateChanged(int arg0) {
                  // TODO Auto-generated method stub
              }
          });
      }
  
      @Override
      public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
              // TODO Auto-generated method stub
      }
  
      @Override
      public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
              // TODO Auto-generated method stub
      }
  
  
  
      @Override
      public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
              // TODO Auto-generated method stub
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  }
  </code></pre>