1:问题描述:
(1)当尝试获取当前网络模式的时候调用了 manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState(),可是在部分机型上却报错了!
(2)NetworkInfo info = connManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
String currentAPN = info.getExtraInfo(); 也报错了!
2:解决方案:
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo()
networkInfo .getType()==ConnectivityManager.TYPE_MOBILE去判断