:1秒間
myEditText.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
//do something
}
public void beforeTextChanged(CharSequence s, int start, int count, int after){
//do something
}
public void onTextChanged(CharSequence s, int start, int before, int count) {
//do something
}
});
この試してみてください。フォーカスをチェックするため
etTo.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
// TODO Auto-generated method stub
}
});
を使用してみてください
myEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
yourcalc();
return true;
}
return false;
}
});
重複する質問... http://stackoverflow.com/questions/904376/android-key-event-problem – himanshu