title: Allow toast to be accessible from another class
body: <p>I am trying to use a toast from another class. </p>
  
  <p>In class 1 I have the toast method:</p>
  
  <pre><code>public static void textToast(String textToDisplay) 
  {
      Context context = getApplicationContext();
      CharSequence text = textToDisplay;
      int duration = Toast.LENGTH_SHORT;
  
      Toast toast = Toast.makeText(context, text, duration);
      toast.setGravity(Gravity.CENTER_HORIZONTAL|Gravity.CENTER, 50, 50);
      toast.show();
  }
  </code></pre>
  
  <p>I am trying to call this toast from another class but when I make the method static, it says cannot make a static reference to this method <code>getApplicationContext().</code></p>
  
  <p>I access it by using <code>class2.textToast("");</code> </p>
  
  <p>Any advice on this would be appreciated. Thanks</p>