Android - getX () function does not work

0

I'm trying to create a game using java without the use of other libraries. I was able to do everything I needed so far but I am not able to use the getX () function in ImageView controlled by the player in this section:

ImageView player = (ImageView)findViewById(R.id.player);

if(player.getX() == 80){
Toast toast = Toast.makeText(getApplicationContext(), ";)", Toast.LENGTH_SHORT);
toast.show();

}else{
Toast toast = Toast.makeText(getApplicationContext(), ";(", Toast.LENGTH_SHORT);
toast.show();
}

What's wrong?

    
asked by anonymous 27.06.2018 / 20:28

0 answers