修改测试问题

This commit is contained in:
18401019693
2022-08-09 17:56:24 +08:00
parent c3a4b57e18
commit cec82501db
2 changed files with 29 additions and 19 deletions

View File

@@ -3,7 +3,9 @@ package com.yunbao.main.activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
@@ -72,7 +74,26 @@ public class SearchActivity extends AbsActivity {
mEditText.setText("");
}
});
findViewById(R.id.btn_delete).setVisibility(View.GONE);
mEditText.setOnEditorActionListener(onEditorActionListener);
mEditText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!s.toString().trim().isEmpty()) {
findViewById(R.id.btn_delete).setVisibility(View.VISIBLE);
}
}
@Override
public void afterTextChanged(Editable s) {
}
});
//退出检索页面保存搜索记录
findViewById(R.id.btn_back).setOnClickListener(new View.OnClickListener() {
@Override