Guest User

Untitled

a guest
Feb 4th, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. private TextView txt_total;
  2. private TextView text_cost_code;
  3. private double itemamount = 0;
  4. private double itemquantity = 0;
  5.  
  6. itemamount = Double.parseDouble(text_cost_code.getText().toString()); txt_total.setText(Double.toString(itemamount));
  7. edit_qty_code.addTextChangedListener(new TextWatcher() {
  8. public void onTextChanged(CharSequence s, int start, int before,
  9. int count) {
  10. // TODO Auto-generated method stub
  11. if (!edit_qty_code.getText().toString().equals("")
  12. || !edit_qty_code.getText().toString().equals("")) {
  13. itemquantity = Double.parseDouble(edit_qty_code.getText()
  14. .toString());
  15. itemamount = Double.parseDouble(text_cost_code.getText()
  16. .toString());
  17. txt_total.setText(Double .toString(itemquantity * itemamount));
  18. } else {
  19. txt_total.setText("0.00");
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment