下面是我的代码:强制关闭时,附加的setText()
name = (EditText)findViewById(R.id.editText1);
name.addTextChangedListener(new TextWatcher(){
public void afterTextChanged(Editable s) {
name.setText(s.toString()+"-");
}
public void beforeTextChanged(CharSequence s, int start, int count, int after){ }
public void onTextChanged(CharSequence s, int start, int before, int count){ }
});
,但我得到了应用强行关闭,当删除的setText()的应用程序工作正常
http://stackoverflow.com/questions/7459966/android-change-edittext-after-each-change 请参阅您刚才的问题。 – PH7
当应用程序强行关闭时,logcat中通常有确切的原因。请发布您的logcat。 – Salw