我得到了错误的 3G 网络小区 ID,我得到了正确的 2G 小区 ID 值,我不明白我哪里出错了。请帮忙
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager
.getCellLocation();
//Cell Id, LAC
int cid = cellLocation.getCid();
int lac = cellLocation.getLac();
//MCC
String MCC =telephonyManager.getNetworkOperator();
int mcc = Integer.parseInt(MCC.substring(0, 3));
String mcc1 = String.valueOf(mcc);
//Operator name
String operatoprName = telephonyManager.getNetworkOperatorName();
我还授予了AndroiManifest.xml
文件ACCESS_COARSE_LOCATION、ACCESS_NETWORK_STATE的权限