下面是我的代碼:強制關閉時,附加的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