0
我正在做一个简单的测试(尝试null检查一个值),只是为踢我决定null检查一个make/nonxistant值:“striiing”这不存在我的任何地方源代码。然后我检查了我的logcat和实现为出现这种不存在的价值:Logcat空检查返回的假阳性
04-18 04:40:22.197: D/com.game.demo.Level1(15800): Broken Value! Debug! Debug!
执行以下时:
if ("striiing" != null) {
Log.d(TAG, "Broken Value! Debug! Debug!");
prefs.getBoolean("name", true);
prefs.getBoolean("player", true);
prefs.getBoolean("points", true);
prefs.getBoolean("level", true);
prefs.getBoolean("gear", true);
任何人都可以解释为什么一个不存在的值可以/将显示为NOT NULL ?这很奇怪。
优秀!谢谢!! –