There is an EditText(edit) and a Button(btn) on screen.
User can click the EditText to input something, and I also want when user click the button, user can input something to the EditText too.
I tried:
btn.setOnClickListener(new View.OnclickListener() {
public void onClick(View v) {
edit.requestFocus();
edit.performClick();
}
});
But it doesn’t work. Although edit get the focus, but the IME doesn’t show.
performClick()works only when you implement theonClickListenerfor that particular View.So, do this in the
onClickof yourEditTextorButton