Android GsmCellLocation.getCellLocation返回NULL

Android GsmCellLocation.getCellLocation返回NULL   

 1、首先 获取服务 telephonyManager =(TelephonyManager)
getSystemService(TELEPHONY_SERVICE);

// 2、注册监听器 telephonyManager.listen(celllistener,
// PhoneStateListener.LISTEN_CELL_LOCATION); // 基站位置的变化
//
// 3、编写监听代码
// public PhoneStateListener celllistener = new PhoneStateListener() {
// @Override
// public void onCellLocationChanged(CellLocation location) {
// super.onCellLocationChanged(location);
// // 判断 location的类型 是GsmCellLocation 还是 CdmaCellLocation
// // 最后 根据你的业务 需求 实现你的代码
//
// }
// };

posted @ 2016-09-21 16:23  居后不争  阅读(2827)  评论(0编辑  收藏  举报