title: Android onKey() is never called
body: <p>I want to listen to key events for my <code>EditText's</code>, and whenever <code>next</code> is pressed I want to save text of <code>EditText</code> to my data object. I implemented <code>OnKeyListener</code> and its <code>onKey()</code> method which is never called and cant get why... Here's my code:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
      savedInstanceState) {
      v = inflater.inflate(R.layout.frag_userprofile_myinfo, container, false);
      context = getActivity().getApplicationContext();
      global = (eKeshGlobal) context;
  
      pbWait = (ProgressBar) v.findViewById(R.id.pbWait);
  
      bnDone = (Button) v.findViewById(R.id.bnDone);
      rlBack = (RelativeLayout) v.findViewById(R.id.rlBack);
  
      etFirstName = (EditText) v.findViewById(R.id.etFirstName);
      etLastName = (EditText) v.findViewById(R.id.etLastName);
      etAdress = (EditText) v.findViewById(R.id.etAdress);
      etMobile = (EditText) v.findViewById(R.id.etMobile);
      etDob = (EditText) v.findViewById(R.id.etDob);
      etOib = (EditText) v.findViewById(R.id.etOib);
  
      etFirstName.setOnKeyListener(this);
      etLastName.setOnKeyListener(this);
      etAdress.setOnKeyListener(this);
      etMobile.setOnKeyListener(this);
      etDob.setOnKeyListener(this);
      etOib.setOnKeyListener(this);
  
  
      return v;
  
  }
  
  @Override
  public boolean onKey(View v, int keyCode, KeyEvent event) {
      if ((event.getAction() == KeyEvent.ACTION_DOWN) &amp;&amp; (keyCode == 
  KeyEvent.KEYCODE_ENTER)) {
  
          switch(v.getId()) {
  
          case R.id.etFirstName:
              user.setFirstName(etFirstName.getText().toString());
              return true;
  
          case R.id.etLastName:
              user.setLastName(etLastName.getText().toString());
              return true;
  
          case R.id.etAdress:
              user.setAddress(etAdress.getText().toString());
              return true;
  
          case R.id.etMobile:
              user.setMobile(etMobile.getText().toString());
              return true;
  
          case R.id.etDob:
              user.setDateOfBirth(Utils.formatDate(context, 
  etDob.getText().toString()));
              return true;
  
          case R.id.etOib:
              user.setOib(etOib.getText().toString());
              return true;
  
          default:
              return false;
          }   
      }
  
      return false;
  }
  </code></pre>
  
  <p>Of course I've implemented listener:</p>
  
  <p><code>public class UserProfileMyInfo extends Fragment implements View.OnKeyListener</code></p>
  
  <p>And here's the sample of <code>EditText</code> xml:</p>
  
  <pre><code>&lt;EditText
        android:id="@+id/etLastName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="left"
        android:ems="10"
        android:hint="@string/my_profile_lastname"
        android:imeOptions="actionNext"
        android:inputType="text"
        android:singleLine="true" /&gt;
  </code></pre>
  
  <p>I'm really running out of ideas to get this work, I tryed with <code>onKeyDown()</code> too but didn't work either.. Thanks in advance!</p>