zoukankan      html  css  js  c++  java
  • 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
    // // 最后 根据你的业务 需求 实现你的代码
    //
    // }
    // };

  • 相关阅读:
    uva-11361
    HDU
    LCS
    CodeForces
    linux 有趣的命令组合
    opencv识别封闭区域 并标记该区域
    宜出行人口热力图
    美团酒店
    赶集租房
    发送企业微信应用通知
  • 原文地址:https://www.cnblogs.com/umlzhang/p/5893136.html
Copyright © 2011-2022 走看看