title: How to access FragmentManger from context from a class that does not extend FragmentActivity
body: <p>I am developing an android application in which I need to launch an Fragment from the class which doesnot extend  FragmentActivity . I am using support v4 package.
  I will having the context in my current class. Can any one help me how to create FragmentManager object from current context?</p>
  
  <pre><code>public ToolBarGenerator(Context c)
  {
        context = c;
  }
  
  FragmentManager fm = (FragmentActivity)context.getSupportFragmentManager(); //getting error at this line.
  //Called like the above
  new ToolBarGenerator(getActivity())
  </code></pre>