Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private TextView txt_total;
- private TextView text_cost_code;
- private double itemamount = 0;
- private double itemquantity = 0;
- itemamount = Double.parseDouble(text_cost_code.getText().toString()); txt_total.setText(Double.toString(itemamount));
- edit_qty_code.addTextChangedListener(new TextWatcher() {
- public void onTextChanged(CharSequence s, int start, int before,
- int count) {
- // TODO Auto-generated method stub
- if (!edit_qty_code.getText().toString().equals("")
- || !edit_qty_code.getText().toString().equals("")) {
- itemquantity = Double.parseDouble(edit_qty_code.getText()
- .toString());
- itemamount = Double.parseDouble(text_cost_code.getText()
- .toString());
- txt_total.setText(Double .toString(itemquantity * itemamount));
- } else {
- txt_total.setText("0.00");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment