title: android fragment switching
body: <p>Now I am doing an application using fragments.
  So i care a fragment activity with four fragments fragment A,fragment B, fragment C, Fragment D.
  By default Fragment A will be selected and on tab click I can switch to fragment B,C,D or A.</p>
  
  <p>My problem is I want to check a condition in fragment A and depends on result switch to fragment B.Like.</p>
  
  <pre><code>Intent in=new Intent(src,destination);
  startactivity(in)
  </code></pre>
  
  <p>I want to switch to other fragment without clicking tab button.Following is the code i used to add fragment.I want to check a condition depends on that condition fragment a,fragment b tab will selected</p>
  
  <pre><code> ActionBar bar = getSupportActionBar();
      bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
      ActionBar.Tab tab1 = bar.newTab();
      ActionBar.Tab tab2 = bar.newTab();
      tab1.setText("Fragment A");
      tab2.setText("Fragment B");
      tab1.setTabListener(new MyTabListener());
      tab2.setTabListener(new MyTabListener());
      bar.addTab(tab1);
      bar.addTab(tab2);
  </code></pre>
  
  <p>please help me friends.</p>