title: avoid reloading on back pressed in fragments
body: <p>I am making an app for car finding.I am showing result in gridview and also have a sliding menu on right hand side(for search filter).I have made this whole app with the help of fragments.In the gridview I have a load more footer at bottom, when I click on 12th position gridview , I am starting another fragments like this:</p>
  
  <pre><code>SearchDetailActivity.goToFragment(ProductDetailFragment.newInstance(map,position));
  </code></pre>
  
  <p>and in ProductDetailFragment I have a back button,to go back on previous fragment like this:</p>
  
  <pre><code>SearchDetailActivity.goToFragment(SearchDetailFragment.newInstance(str_url));
  </code></pre>
  
  <p>Now when I came back again data shows from 0-10th item.</p>
  
  <p>In goToFragment() I have write this code:</p>
  
  <pre><code>public static void goToFragment(Fragment fragment) {
      Log.d("GoToFrag","sjdk&gt;&gt;"+fragment);
      Fragment tmp = fm.findFragmentByTag(fragment.getClass().getName());
      if (tmp != null &amp;&amp; tmp.isVisible())
          return;
  
      ft = fm.beginTransaction();
      ft.replace(R.id.main_fragment, fragment, fragment.getClass().getName());
      ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
      ft.commit();
      currentTag = fragment.getClass().getName();
  }
  </code></pre>
  
  <p>I want to avoid data reload when come back from ProductDetailFragment.If I used Activity then I can use onBackPressed() to back and avoid reloading but in Fragment when I pressed app's back button ,It reload the SearchDetatilFragment,which is very annoying..Please help me..Thanks in advance.</p>