なぜこれは偽なのですか?わかりません。DataBaseHelper.getBoolean(); 文字列値です。このifステートメントでは、同じ結果を出力しますが、互いに等しくないと言っています..
String a = DataBaseHelper.getBoolean(id);
String b = DataBaseHelper.getBoolean(id);
if (a==b){
newTextView.setText(DataBaseHelper.getBoolean(id) + " == " + DataBaseHelper.getBoolean(id) + " is TRUE \n");
} else {
newTextView.setText(DataBaseHelper.getBoolean(id) + " == " + DataBaseHelper.getBoolean(id) + " is FALSE \n");
}
toher クラスの getBoolean メソッド。
public String getBoolean(int randomIndex) {
// TODO Auto-generated method stub
open();
Cursor c = myDataBase.query(TABLE_NAME1, columns, WHATTODONOW_COLUMN_ID
+ "=" + randomIndex, null, null, null, null);
if (c != null) {
c.moveToFirst();
String text = c.getString(8);
return text;
}
closee();
return null;
}