To All. Right now i am working on App which launches a dialog(containing EditText) on any alphanumeric key pressed from keyboard. Now i want that whatever user type should appear in EditText box, which is working properly the only issue that i have is, i want the char key which was 1st pressed to open dialog in EditText Box. I am missing the 1st char key which is obviously right. But I retrieve that char as string separately. Now wanted to attach(show) that char key to inputted EditText from user as 1st letter. I tried this,
{
final EditText search_d_text = (EditText) dialog
.findViewById(R.id.search_text1);
search_d_text.setText(s1);// si is the 1st char key launch dialog(containing edittext).
search_d_text.setInputType(InputType.TYPE_NULL);
search_d_text
.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId,
KeyEvent event) {
if (event != null
&& event.getAction() == KeyEvent.ACTION_DOWN) {
// Handle enter key
return true;
}
if (actionId == EditorInfo.IME_ACTION_NEXT) {
// Handle IME NEXT key
return true;
}
if (actionId == EditorInfo.IME_ACTION_DONE) {
// Handle IME DONE key
return true;
}
return false;
}
});
search_string = search_d_text.getText().toString();
enterd_text = search_d_text.getText();
// collecting input text.
}
What i am getting is eg. when i type MASK, It shows ASKM.
The setText(s1) is always act as last letter. I want to show the word or whatever user input starting from 1st key. Thank You.