title: Android - Make Toast from static method
body: <p>I'm trying to pass a string from a separate static java class, to a method inside my Blankfragment.java</p>
  
  <p>this is the method inside the blankFragment.java, the problem is that it can't access getContext() which is non static.</p>
  
  <pre><code>public static void ShowMessage(String message){
      Toast.makeText(getContext() ,message , Toast.LENGTH_LONG).show();
  }
  </code></pre>
  
  <p>And the method call in the <strong>separate</strong> <strong>static</strong> java class:</p>
  
  <pre><code>BlankFragment.ShowMessage(new String(body));
  </code></pre>
  
  <p>Is there a way to retrieve the context from outside and pass it as a parameter? getContext() does not work, I get the error "cannot resolve symbol"</p>