Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- subtractButton.setOnClickListener(l -> {
- if (value1.getText().toString().isEmpty() || value2.getText().toString().isEmpty()) {
- Toast.makeText(this, "Введите сначала значения", Toast.LENGTH_LONG).show();
- resultView.setText("ERROR");
- return;
- }
- Float v1 = Float.parseFloat(value1.getEditableText().toString());
- Float v2 = Float.parseFloat(value2.getEditableText().toString());
- Float result = v1 - v2;
- resultView.setText(result.toString());
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement