public class Uuid extends Activity {
private String uuid;
public Uuid(Context mContext) {
final TelephonyManager tm = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
final String tmDevice, tmSerial, androidId;
tmDevice = "" + tm.getDeviceId();
tmSerial = "" + tm.getSimSerialNumber();
androidId = "" + android.provider.Settings.Secure.getString(<span style= "color:#ff0000;" >getContentResolver()</span>, android.provider.Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(), (( long ) tmDevice.hashCode() << 32 ) | tmSerial.hashCode());
String deviceId = deviceUuid.toString();
this .uuid = deviceId;
}
public String getUuid() {
return uuid;
}
}
|
위를 액티비티 상속받지 말라고 말씀하셨는데 상속받지 않으면
getContentResolver() 부분이 오류가뜹니다.
그래서 검색하여보니mContext.getApplicationContext() 하라고 해서 해도 해결이 안되네요..
어떻게 해야할까요?... 고수님 조언 부탁드립니다.