vendredi 2 septembre 2016

If, else if statement not working in Android studio

maybe it is something very small that I am missing but somehow my if statement doesnt work. I want to check if the x of the position of a picture if greater than the screen width but somehow i get the errors: "else without if" and ")" or "; expected" Here is my code:

 if (image.getX() => screenWidth){
        image.animate().xBy(- (screenWidth + 120));
    }else if (image.getX() <= -120){
        image.animate().xBy(screenWidth+120).setDuration(5000).start();
    }

Aucun commentaire:

Enregistrer un commentaire