java需要帮助检查值是否为1
我需要检查一个值是否为-1。我编译的一些源代码有问题,我不知道如何解决here的问题
我知道我需要实施:
if(wifiManager.addNetwork(conf) == -1) {
// Insert code to handle the failure here.
} else {
// The rest of your code for the 'success' case here!
}
但我不确定应该插入什么来处理失败
你可以在下面搜索框中键入要查询的问题!
我需要检查一个值是否为-1。我编译的一些源代码有问题,我不知道如何解决here的问题
我知道我需要实施:
if(wifiManager.addNetwork(conf) == -1) {
// Insert code to handle the failure here.
} else {
// The rest of your code for the 'success' case here!
}
但我不确定应该插入什么来处理失败
# 1 楼答案
您可以通过在
if
语句中比较wifiManager.addNetwork(conf);
的结果来完成此操作我假设你在和Android's ^{} 合作