I have a number of EditTexts in my page along with two buttons. I want the user to touch on any one EditText field and click any button to insert a
EditText
This worked for me.
e1 = (EditText) findViewById(R.id.editText1); e1.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View arg0, boolean hasfocus) { if (hasfocus) { Log.e("TAG", "e1 focused") } else { Log.e("TAG", "e1 not focused") } } });