我需要slave sim的cell id
和location id
;但它总是为两者返回 0 并且我的主插槽 sim 卡不存在。我如何正确获取它?顺便说一句,我已经正确检查了 SIM
是否存在。
我的代码是:
final GsmCellLocation locationG = (GsmCellLocation) tel.getCellLocation();
if (locationG != null)
{
cellId = locationG.getCid();
lac = locationG.getLac();
cellId = cellId & 0xffff;
}
最佳答案
//you need to check if 2G or 3G
lac = String.valueOf(finalLocation.getLac());
cellId = String.valueOf(finalLocation.getCid());
if(3G) {
cellId= String.valueOf( Integer.valueOf( cellId)& 0xffff);
lac= String.valueOf( Integer.valueOf( lac)& 0xffff);
}
关于java - Android 无法在双 SIM 卡手机中捕获从属 SIM 卡的 Cell Id 和位置 Id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24781627/