title: How to implement Action Bar with Fragment?
body: <p>Am using Actionbar with Tabs..I need to change the Action bar items and title depending on Tab selection.I can change the title but i cannot change the item's icon. </p>
  
  <p>Because actionBar.setTitle() is defalut method. Like that there is no default method for icon and item change..Action Bar can be used in Activity not Fragment..How to handle this situation? Please help me</p>
  
  <p>Am using below code..                                           </p>
  
  <p>public class ActionBarActivity extends Activity{</p>
  
  <pre><code>public static Context context;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.actionbar);
      ActionBar actionBar = getActionBar();
      actionBar.setTitle("Action Bar");
      actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
      actionBar.show();
  
  
  
      ActionBar.Tab aTab = actionBar.newTab().setText("A");
      ActionBar.Tab bTab = actionBar.newTab().setText("B");
      ActionBar.Tab cTab = actionBar.newTab().setText("C");
  
      Fragment aFragment = new aActivity();
      Fragment bFragment = new bActivity();
      Fragment bFragment = new cActivity();
  
      aTab .setTabListener(new MyTabsListener(aFragment));
      bTab.setTabListener(new MyTabsListener(bFragment));
      cTab.setTabListener(new MyTabsListener(cFragment));
  
      actionBar.addTab(aTab );
      actionBar.addTab(bTab);
      actionBar.addTab(cTab);
  
  
  }
  
  @Override
   public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater menuInflater = getMenuInflater();
          menuInflater.inflate(R.menu.menu, menu);
          return super.onCreateOptionsMenu(menu);
  
   }
  </code></pre>