title: Cannot make a static reference to the non-static method getIMEI() from the type Util
body: <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      String test =  Util.imei();
  }
  
  
  import android.content.Context;
  import android.telephony.TelephonyManager;
  
  public class Util{
      Context context;
  
      public Util(Context context) {
          this.context = context;
      }
  
      public String imei() {
          TelephonyManager telephonyManager = (TelephonyManager) context
                  .getSystemService(Context.TELEPHONY_SERVICE);
          return telephonyManager.getDeviceId();
      }
  }
  </code></pre>
  
  <p>Getting error "Cannot make a static reference to the non-static method imei() from the type Util".
  If I change the line to:</p>
  
  <pre><code>public static String imei() {
      ...
      static Context context;
  </code></pre>
  
  <p>I get an error and crash app.("E/AndroidRuntime(629): Caused by:java.lang.NullPointerException")</p>