Following is my code. When I click the EditText system doesn't trigger the intent, instead it brings up the keyboard on second click only it triggers the intent. How to make sure it happens on first click.
description.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//Toast.makeText(sendingpage.this, description.getText(), 2000).show();
Intent fullscreen = new Intent(sendingpage.this, ShowSummeryActivity.class);;
startActivity(fullscreen);
}
});
Thanks for your time in advance.
I don't know why you get this behaviour, i got the same code and it works fine both on emulator and HTC device. Anyway you can hide the soft keyboard manually by using the InputMethodManager
. Add this to your onClick
method.
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(description.getWindowToken(), 0);