title: Simple text Display method from another class nullpointerexception
body: <p>I have a GPSLoc class with the following method</p>
  
  <pre><code>public  class GPSLoc   { 
      public static void HAHA ()
        {
            {Toast.makeText( context,"SD Card not available , savin to local phone", Toast.LENGTH_LONG).show();};
        }
  
        private static  Context context;
  </code></pre>
  
  <p>then I am creating a button in the main activity with the simple task of calling that method and display the toast</p>
  
  <pre><code>Button three=(Button)findViewById(R.id.three);
  three.setOnClickListener(new Button.OnClickListener() {
  
      public void onClick(View v) {
  
          GPSLoc Test1=new GPSLoc();  
          Test1.HAHA();
  
      }
  </code></pre>
  
  <p>and then I got that in the LogCat</p>
  
  <pre><code> 07-13 20:41:39.492: E/AndroidRuntime(6778): FATAL EXCEPTION: main
    07-13 20:41:39.492: E/AndroidRuntime(6778): java.lang.NullPointerException
    07-13 20:41:39.492: E/AndroidRuntime(6778):   at android.widget.Toast.&lt;init&gt;(Toast.java:90)
    07-13 20:41:39.492: E/AndroidRuntime(6778):   at android.widget.Toast.makeText(Toast.java:232)
    07-13 20:41:39.492: E/AndroidRuntime(6778):   at com.example.testnewbutton.GPSLoc.HAHA(GPSLoc.java:100)
    07-13 20:41:39.492: E/AndroidRuntime(6778):   at com.example.testnewbutton.MainActivity$1.onClick(MainActivity.java:67)
  </code></pre>