I am getting the getNeighboringCellInfo()
using TelephonyManager
.I want list out the neighboringcells details in the listview.I successfully getting the neighboringcells but I could't display in the list view Please help me solve this problem.
listedSignals = (ListView)findViewById(R.id.listSignals);
private void getNeighbors(TelephonyManager telephonyManager) throws InterruptedException {
List<NeighboringCellInfo> neighboringCellInfos;
neighboringCellInfos = telephonyManager.getNeighboringCellInfo();
neighboringCellBlockingQueue = new LinkedBlockingQueue<>(100);
for (int i = 0;i < neighboringCellInfos.size();i++) {
NeighboringCellInfo info = neighboringCellBlockingQueue.poll(1, TimeUnit.SECONDS);
ArrayList<NeighboringCellInfo> cellInfoList = new ArrayList<>(neighboringCellBlockingQueue.size() + 1);
while (info != null) {
cellInfoList.add(info);
info = neighboringCellBlockingQueue.poll(1, TimeUnit.SECONDS);
}
neighboringCellInfos = cellInfoList;
}
}
the neighboringCellInfos
have the details of all neighboring cells.So please tell me using neighboringCellInfos
in the listedSignals
listview.