一 前端
<EditText
android:id="@+id/editTextText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text"
android:text="Name" />
二 后台代码
binding.editTextText2.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
Toast.makeText( binding.editTextText2.getContext(), "内容变化之前", Toast.LENGTH_SHORT).show();
}
&