Android 애플리케이션에서 LAC 및 Cid 코드를 가져와야합니다. 그러나, 나는 그것을 Activity 클래스 내부에서 할 필요가있다.비 액티비티 클래스의 getSystemService
TelephonyManager telephonyManager =(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager.getCellLocation();
int cid = cellLocation.getCid();
int lac = cellLocation.getLac();
그러나, 메소드 setSystemService는 작업 클래스에 존재하는, 내가 클래스에 "활동의 일종"를 보낼 수있는 무언가를 발견하지 않았습니다 : 내가 찾은 코드는 다음입니다. 활동이 없어도 그렇게 할 수 있습니까?