Capturing values at the push of a button

2

Good evening! I am developing an app to calculate the amount to invoice labor for customers according to the type of service. However I am having difficulty in the last screen where it will generate a billing report, I wanted to see how I got these values from the other screens, remembering that the time value will change according to the type of service, but the values are already set in the app. The user will only report the number of hours he performed the service and the application will return with the amount to be charged.

    
asked by anonymous 26.11.2015 / 01:46

1 answer

0

When you talk about 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 the Bundle + Intent.

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

On the button, you can add a listener to get the action by clicking it.

    botaoNovoCalculo.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            // seu código.
        }
    });
    
26.11.2015 / 02:00