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
// // 最后 根據你的業務 需求 實現你的代碼
//
// }
// };