mardi 31 mars 2015

Why does the code run a command, even if it's if statement isn't fulfilled?

When I run my code in debug mode, I can see, that for the value "ooy" another content is set(and it would be correct like this) than for the value "skii". But the code still starts the Activity "Game.class", and the Activity "Tutorial.class" too but only in background. how can I solve this?



@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.btn_start) {


startActivity(new Intent(this,Tutorial.class));


if (!ooy.equals(skii)){
startActivity(new Intent(this,Game.class));
}

}

Aucun commentaire:

Enregistrer un commentaire