title: Get access to getSupportFragmentManager in non activity class
body: <p>I hope someone can help.
  I have a non activity class in which I need to access the fragmentmanager in a <strong>static</strong> method, unfortunatly I don`t know how to pass the context correctly.</p>
  
  <p>Any help is appreciated,</p>
  
  <p>Non activity class:</p>
  
  <pre><code>public class testClass {
  ..
  public synchronized static void checkNewdata(List&lt;data&gt;input, Context context) {
  ..
         FragmentManager ft = ((FragmentActivity)???).getSupportFragmentManager();
                  DialogFragment newFragment = MyNotification.newInstance();
                  newFragment.setCancelable(false);
                  newFragment.show(ft, "mydialog");
  ..
     }
  }
  </code></pre>
  
  <p>The method checkNewdata is also being called from a non activity class, in which I try to pass context but this doesn`t work:</p>
  
  <pre><code>public class SearchResponse extends SuccessResponse {
  
  private Context mcontext;
  
  public SearchResponse(Context context){
      mcontext = context;
  }
  ..
  @Override
      public void save() {
  ..
      testClass.checkNewdata(mainData, context);
  ..
     }
  }
  </code></pre>