title: Clearing previously entered text in EditText field
body: <p>Hey,
  I'm trying to get my editText window to clear its contents when either:
  1) It is reselected to enter different data or
  2) A button is pressed to input predetermined data</p>
  
  <p>This is not hint text. At the moment once the predetermined data is input it stays there and I can't clear it, even using delete.
  I have tried putting editBox.setText("") in the onClick Listener and the addTextChangedListener (both before and on methods) using a boolean to determine if code has already been input, but it just ignores it.</p>
  
  <pre><code>foodBox.addTextChangedListener(new TextWatcher(){
  
          @Override
          public void afterTextChanged(Editable s) {
  
          }
          public void beforeTextChanged(CharSequence s, int start, int count,
                  int after) {
  
          }
  
          @Override
          public void onTextChanged(CharSequence s, int start, int before,
                  int count) {
              addFood();
              valueAdded=true;
          }           
      });
  
  
      dogButton.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              if (valueAdded==true){
                  foodBox.setText("");
                  setFood(0.0);
              }
              isClicked=true;
              animal=1;
              addFood();
              valueAdded=true;//value in the box
                  }
  
  
      });
  
  
      catButton.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              if (valueAdded){
                 foodBox.setText("");}
              isClicked=true;
              animal=2;
              addFood();
              valueAdded=true;
              }
  
      });
              private void addFood() {
      try{
          aClass aob = new aClass();
          setFood(0.0);
          String a = this.foodBox.getText().toString();
          if(isClicked&amp;&amp;TextUtils.isEmpty(a)){
              if(animal==1){
                  a=mob.getDog(); 
              }
              if(animal==2){
                  a=mob.getCat();
              }
              this.foodBox.setText(a);
              double d=Double.parseDouble(a);
              setFood(d);
          }else{
              if(TextUtils.isEmpty(a)){
              a="0";
          }
          double d=Double.parseDouble(a);
          setFood(d);
          }
      } 
          catch (Exception e){
          this.showAnswer.setText("Please input animals in numbers");
          addFood();
      }
  }
  </code></pre>
  
  <p>Thanks</p>