Here a little help to start off.
First you should add an OnClickListener to your button:
yourButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
handleButtonClick();
}
});
The handleButtonClick()-method could look like this:
private void handleButtonClick() {
// Here we get a random integer between 0 and 99 (including 0 and 99)
int randomNumber = new Random().nextInt(100);
// Here we check if the random number is even
boolean isEven = randomNumber % 2 == 0;
// Now you can do stuff depending on the integer itself (rotation)
// and depending on whether it's even or not.
if(randomNumber < 50){
// do this
} else {
// do that
}
if(isEven){
// do this
} else {
// do that
}
}
To change the text you use:
yourText.setText(...);
But this is really basic stuff you could read on Android TextView
And rotating images was discussed here Android: Rotate image in imageview by an angle
Please read tutorials or refer to this before asking every little thing you could easily look up. Feel free to ask again when you get stuck.
Good luck.