title: how to call Activity class from Fragment
body: <p>I am working with Navigation Drawer and i want to call testActivity.java class when someone click on a item that is in the sliding menu.Currently my MainActivity.java calss is calling to the FragmentOne,FragmentTwo,FragmentThree when sliding menu item selected..I want to replace this with testActivity.java</p>
  
  <p>here is my MainActivity.java </p>
  
  <pre><code> public class MainActivity extends FragmentActivity {
  final String[] data ={"one","two","three"};
  final String[] fragments ={
          "core.layout.FragmentOne",
          "core.layout.FragmentTwo",
          "core.layout.FragmentThree"};
  @Override
  protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);
  
       ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;    (getActionBar().getThemedContext(), android.R.layout.simple_list_item_1, data);
  
       final DrawerLayout drawer = (DrawerLayout)findViewById(R.id.drawer_layout);
       final ListView navList = (ListView) findViewById(R.id.drawer);
       navList.setAdapter(adapter);
       navList.setOnItemClickListener(new OnItemClickListener(){
               @Override
               public void onItemClick(AdapterView&lt;?&gt; parent, View view, final int pos,long id){
                       drawer.setDrawerListener( new DrawerLayout.SimpleDrawerListener(){
                               @Override
                               public void onDrawerClosed(View drawerView){
                                       super.onDrawerClosed(drawerView);
                                       FragmentTransaction tx = getSupportFragmentManager().beginTransaction();
                                       tx.replace(R.id.main, Fragment.instantiate(MainActivity.this, fragments[pos]));
                                       tx.commit();
                               }
                       });
                       drawer.closeDrawer(navList);
               }
       });
       FragmentTransaction tx = getSupportFragmentManager().beginTransaction();
       tx.replace(R.id.main,Fragment.instantiate(MainActivity.this, fragments[0]));
       tx.commit();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>here is my FragmentOne.java calss..All other FragmentTwo and FragmentThree.java classes having same code like this.</p>
  
  <pre><code>      public class FragmentOne extends Fragment {
  
  
  public static Fragment newInstance(Context context) {
      FragmentOne f = new FragmentOne();
  
      return f;
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
     ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_one, null);
  
      View view = inflater.inflate(R.layout.fragment_one,container, false);
  
     return root;
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This is my testActivity.java class </p>
  
  <pre><code>   public class testActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.test);
  
  
  }
  </code></pre>
  
  <p>}</p>