Activity is not called on Android [closed]

-1

My code calls an activity within a function, to receive user information (through some public variables): . ... instructions .

Intent i = new Intent(this, confirmar.class);
startActivity(i);
.
... instrucciones que procesan datos recibidos de activity confirmar
.

.

The problem is that the "confirm" activity is only activated at the end of the routine containing the call and therefore the instructions following the call are executed before the form requesting the information is displayed to the user . Any explanation to this?

    
asked by Jairo Tovar 30.03.2017 в 19:23
source

1 answer

1

Your question is not very clear, but it seems to me that your problem is because the instructions in the "Activity" are made in another thread. Therefore in your function, the call to Confirm is made and the thread continues execution. If you want the content of the activity to be done and then make more code, you have to use callback parameters, that is, another function that will be executed when the activity ends. It is not possible to stop the execution so that the activity is carried out and then the same function continues its procedural cycle. You have to split that function in two. Terminate it by calling the activity but passing in the callback parameter the name of the function where the execution continues.

If you add code it will be easier to give you a solution with code as well.

    
answered by 30.03.2017 / 19:43
source