果冻豆问题-wifiManager.getConnectionInfo().getSSID()-额外的“" [英] Jelly Bean Issue - wifiManager.getConnectionInfo().getSSID() - extra ""

查看:389
本文介绍了果冻豆问题-wifiManager.getConnectionInfo().getSSID()-额外的“"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,所有错误报告均供您参考. 链接

Hi all bug reporting for your information. link

问题详细信息:

代码-wifiManager.getConnectionInfo().getSSID()

上面的代码返回当前的SSID,它返回当前的SSID,并带有额外的引号.

The above code to returns the current SSID, it is returning the current SSID with extra quotations around it.

例如SSID internet作为"internet"返回.

For eg. the SSID internet is returned as "internet".

仅在使用设备Nexus 7的Jelly bean 4.2上可见.

This is only seen on Jelly bean 4.2 using device Nexus 7.

此错误在我们的应用程序中引起错误,因为我们将当前的SSID与我们也尝试连接的SSID进行了比较.

This bug is causing errors in our app as we compare the current SSID with the SSID that we are trying to connect too.

但是代码wifiManager.getScanResults();仍然返回所有SSID,而没有多余的引号.

The code wifiManager.getScanResults(); however still returns all SSID's without extra quotation marks.

推荐答案

这不是错误,根据所谓的bug显然是在4.2之前的设备中,因为它们没有使用"附件将其返回.

The so-called bug apparently was in pre 4.2 devices, because they didn't return it with "" enclosure.

在Android造成的当前混乱状态下,艾登的方法对我来说看起来不错.但是,从理论上讲,正确无误只需要

Aiden's method looks good to me in the current state of confusion left by Android. However, being theoritically correct would just require

if (ssid.startsWith("\"") && ssid.endsWith("\"")){
             ssid = ssid.substring(1, ssid.length()-1);
}

这篇关于果冻豆问题-wifiManager.getConnectionInfo().getSSID()-额外的“"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆