Capture values via a button

Asked

Viewed 36 times

2

Good night ! I am developing an app to perform calculation of the amount to bill from labor to customers according to the type of service. However I’m having difficulty in the last screen where will generate a billing report, I wanted to see how I picked these values from other screens, remembering that the value of time will change according to the type of service, but the values I will already leave defined in the app. The user will inform only the amount of hours he performed the service and the application will return with the amount to be charged. inserir a descrição da imagem aqui

1 answer

0


When you speak other screens means other activities?

If yes, you can pass values between activities using Bundle that you send along with the Intent. Here’s a good example on how to use Bundle + Intent.

Or you can still use static variables for this, although it is not a good practice.

On the button, you can add a Slider to catch the action by clicking on it.

    botaoNovoCalculo.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            // seu código.
        }
    });
  • That’s right ! will have other activities where the user will click and move to the next screen added on the buttons the method trocatela.Dai when clicking on the button ex.: Guarantee button( That is a type of service) it will already go set with the value of the hour to 100,00 Real for the next screen that would inform the amount of hours being that these values would be multiplied and displayed on the last screen of the app that was the one I put in the question. Dai wanted to see how to assign these values to multiply and display on the last screen.

  • @Eduardorodrigues Check out the link I posted. He is your solution.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.