在我的代码中,我将 button.gettext 与 int 值进行比较,两者都是 eqyal 但它不打印 Toast 消息。不比较两个值对我有帮助....
public static int mDay;
Button e01;
public static String[][] a = new String[6][7];
e02.setText("" + a[0][2]);
if(e01.getText().toString().equals(mDay))
{
e01.setTextColor(Color.parseColor("#FFBBFF"));
Toast.makeText(this, "Button2 text equals!", Toast.LENGTH_SHORT).show();
}
//// in debug mode both gives value 29
e01.getText().toString() =29
mDay=29