问题描述
- Android 获取电信4G基站信息问题求大神解答
-
TelephonyManager manager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); if (type == TelephonyManager.NETWORK_TYPE_CDMA // 电信cdma网 || type == TelephonyManager.NETWORK_TYPE_1xRTT || type == TelephonyManager.NETWORK_TYPE_EVDO_0 || type == TelephonyManager.NETWORK_TYPE_EVDO_A || type == TelephonyManager.NETWORK_TYPE_LTE ) { CdmaCellLocation cdma = (CdmaCellLocation) manager.getCellLocation(); if (cdma == null) { return null; } int lac = cdma.getNetworkId(); int cid = cdma.getBaseStationId(); } 获取电信基站信息代码如上,2G,3G,都是好的,但切换到4G,程序就崩溃
解决方案
请查看程序崩溃的日志。4G是LTE。
时间: 2024-10-30 10:32:28