EditText Focus Change 監聽 清除按鈕

edt_採購單號.setOnFocusChangeListener(new View.OnFocusChangeListener()
{
    @Override
    public void onFocusChange(View v, boolean hasFocus)
    {

        if (hasFocus) {
            checkForEdit();  //被Focus
        } else {
            Img_clear.setVisibility(View.INVISIBLE); //取消Focus
        }

    }
});

edt_採購單號.addTextChangedListener(new TextWatcher() {
    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
       checkForEdit();
    }

    @Override
    public void afterTextChanged(Editable editable) {

    }
});

public void checkForEdit(){
    if (edt_採購單號.getText().toString()!=null &&! edt_採購單號.getText().toString().equals("")){
        Img_clear.setVisibility(View.VISIBLE);
    }else {
        Img_clear.setVisibility(View.INVISIBLE);
    }
}