java - How to resolve error "non static method 'getDeviceId()' cannot be referenced by static context" -
this question has answer here:
i'm trying device id in following code
public string getdevid() { string devid=android.telephony.telephonymanager.getdeviceid(); return devid; } but saying "non static method 'getdeviceid()' cannot referenced static context"
public string getdeviceid(context context){ telephonymanager telephonymanager = (telephonymanager)context.getsystemservice(context.telephony_service); return telephonymanager.getdeviceid(); }
Comments
Post a Comment