if in an onClick method
<p>This is my onClick method :</p>

<p>i'm summing up values of buttons that the user click on.</p>

<pre><code>    public void onClick(View arg0) {

    switch (arg0.getId()){
    case R.id.B_l0c0:

        user_sum+=buttonsVals[0][0];//
        break;
    case R.id.B_l0c1:
        user_sum+=buttonsVals[0][1];
        break;
    case R.id.B_l0c2:
        user_sum+=buttonsVals[0][2];
        break;

    case R.id.B_l1c0:
        user_sum+=buttonsVals[1][0];
        break;
    case R.id.B_l1c1:
        user_sum+=buttonsVals[1][1];
        break;
    case R.id.B_l1c2:
        user_sum+=buttonsVals[1][2];
        break;
    case R.id.B_l2c0:
        user_sum+=buttonsVals[2][0];
        break;
    case R.id.B_l2c2:
        user_sum+=buttonsVals[2][2];
        break;
    case R.id.B_l3c0:
        user_sum+=buttonsVals[3][0];
        break;
    case R.id.B_l3c1:
        user_sum+=buttonsVals[3][1];
        break;
    case R.id.B_l3c2:
        user_sum+=buttonsVals[3][2];
        break;
    case R.id.B_l4c0:
        user_sum+=buttonsVals[4][0];
        break;
    case R.id.B_l4c1:
        user_sum+=buttonsVals[4][1];
        break;
    case R.id.B_l4c2:
        user_sum+=buttonsVals[4][2];
        break;
    }
    tvUser.setText(Integer.toString(user_sum));
    if (user_sum == target){
        CharSequence text = "Hello toast!";
        Toast.makeText(Game.this, text, Toast.LENGTH_LONG).show();


    }
}
</code></pre>

<p>But it seems that the if statement doesn't work... and I can'tfind out why..
(user_sum and target are global integers)</p>

<p>thanks for your help</p>
