[Solved] How to resolve error “non static method ‘getDeviceId()’ cannot be referenced by static context” [duplicate]


public String getDeviceId(Context context){
    TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
      return telephonyManager.getDeviceId();
}

4

solved How to resolve error “non static method ‘getDeviceId()’ cannot be referenced by static context” [duplicate]