title: Android FragmentTransaction commit already called
body: <p>My ERROR : </p>
  
  <p>java.lang.IllegalStateException: commit already called</p>
  
  <p>My CODE: </p>
  
  <pre><code>final FragmentTransaction fragmentTransaction =getFragmentManager().beginTransaction();
  
  f1_fragment  = new F1_Fragments();
  f2_fragment = new F2_Fragments();
  
  listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              parent.getItemAtPosition(position);
  
              if(position==0){
                  fragmentTransaction.replace(android.R.id.content, f1_fragment);
              }else{
                  fragmentTransaction.replace(android.R.id.content, f2_fragment);
              }
  
              fragmentTransaction.addToBackStack(null);
              fragmentTransaction.commit();
          }
      });
  </code></pre>