|
import
import android.view.inputmethod.*;
Variablen Deklaration
public InputMethodManager in=null;
onCreate
in = (InputMethodManager) this.getSystemService(this.INPUT_METHOD_SERVICE);
Button OnClick
in.hideSoftInputFromWindow(tresult.getApplicationWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
Hide Tastatur, Anklicken grünen Haken
tresult.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_GO){
// auf goEvent
return true;
}
if (actionId == EditorInfo.IME_ACTION_NEXT){
// auf goEvent
return true;
}
if (actionId == EditorInfo.IME_ACTION_SEND){
// auf goEvent
return true;
}
if (actionId == EditorInfo.IME_ACTION_DONE){ // grüne Haken
//MainActivity.in.hideSoftInputFromWindow(tnumber3.getApplicationWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
bntest_Click(null);
return false;
}
return false;
}
});
|
|