getNeighboringCellInfo() returning null list

前端 未结 2 821
梦谈多话
梦谈多话 2021-01-18 12:19

I\'m struggling a little trying to get neighbour cells info (for the current cell info, everything works fine):

mTelephMgr=(TelephonyManager) getSystemServic         


        
相关标签:
2条回答
  • 2021-01-18 12:55

    This is not a phone brand issue, the reason is that using a 3G connection you can't get any neighboring cell info (returns an empty list). You need to switch to 2G to get it.

    0 讨论(0)
  • 2021-01-18 12:59

    Any ways, im not sure if that works. Because your code doesnt return a LIST. it has to be a list. This is what i have done:-

    TelephonyManager teleManager = (TelephonyManager)getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
    
    List<NeighboringCellInfo> neighborInfo = teleManager.getNeighboringCellInfo();       
    Log.e("xxxxx", "Size: " + neighborInfo.size()  );
    

    This works, because i have used it. But if anyone gets to know why is the List always empty, please do let me know

    0 讨论(0)
提交回复
热议问题