title: getFragmentManager gets the null value while trying to fetch value from a method
body: <p>I have created a method in PlaceDetailsActivity.java given below:       </p>
  
  <pre><code> public void implementFragment()
      {
          TestFrag testingFragmentFragment = new TestFrag();
          FragmentManager fragmentManager = getFragmentManager();
          FragmentTransaction fragmentTransaction =fragmentManager.beginTransaction();
          fragmentTransaction.replace(R.id.map_fragment, testingFragmentFragment);
          fragmentTransaction.commit();
      } 
  </code></pre>
  
  <p>If I try to access this method of PlaceDetailsActivity.java from DetailsInfoActivity.java like this</p>
  
  <pre><code>btn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            PlaceDetailsActivity placeDetailsActivity= new PlaceDetailsActivity();
            placeDetailsActivity.implementFragment();
           finish();
          }
      });
  </code></pre>
  
  <p>I get null value here <code>FragmentManager fragmentManager = getFragmentManager();</code>
  But if I call it from PlaceDetailsActivity's onCreate then it works properly. Here TestFrag is a Fragment class. My question is what to do 
  now if I want to call implementFragment() method of PlaceDetailsActivity.java from DetailsInfoActivity.java without getting  null value?</p>