所以,这根本不起作用。
CheckBox chck_bluetooth = (CheckBox) findViewById(R.id.chck_bluetooth);
if (mProperties.getProperty("bluetooth") == "true") {
chck_bluetooth.setChecked(true);
Log.i("Properties", "bluetooth = " + mProperties.getProperty("bluetooth"));
} else {
chck_bluetooth.setChecked(false);
Log.i("Properties", "bluetooth = " + mProperties.getProperty("bluetooth"));
}好吧,日志告诉我蓝牙设置为"true",所以我猜一定是复选框有问题。
发布于 2011-07-01 00:09:05
如果属性值是字符串,则需要使用equals()进行比较:
if (mProperties.getProperty("bluetooth").equals("true")) {https://stackoverflow.com/questions/6537737
复制相似问题