Draw between Activities [closed]

-2

Good afternoon, I wanted to know how to choose a maximum number in one activity and in the other one to make a draw with the maximum number being the one chosen in the first activity.

    
asked by anonymous 09.12.2018 / 20:46

1 answer

1

Your question is not very clear, but you probably want to pass data between activities . For this you will need a Intent .

Assuming you have generated int and want to pass it between activities :

int seuNumero = 10;

Intent intent = new Intent(SUA_ACTIVITY_ATUAL.class, ACTIVITY_DE_DESTINO.class);
intent.putExtra("seuNumero", seuNumero);
startActivity(intent);

In% destination%, you need the following code to retrieve your number:

int numero = getIntent().getIntExtra("seuNumero");

Consider the Activity method. It is used to retrieve a value of type getIntExtra() . If you're dealing with int , you'll use double etc.

    
10.12.2018 / 10:57