java - How to resolve error "non static method 'getDeviceId()' cannot be referenced by static context" -


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

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -