title: Android: Key Event from Android Box remote controller
body: <p>I was interested to know how can i catch key/button events from Android TV Box remote controller?</p>
  
  <p>For example, i want a popup menu to show when i click the OK button from remote controller. And i want to catch the next/back key events from remote controller.</p>
  
  <p>Should i use the Key Event class from Android, if yes how should i implement it?</p>
  
  <p>I came across this function but i cannot really make sense of it.</p>
  
  <pre><code> @Override 
  public boolean onKeyDown(int keyCode, KeyEvent event) {
  
      switch (keyCode) {
          case KeyEvent.KEYCODE_A:
          {
              //your Action code
              return true;
          }
      }
      return super.onKeyDown(keyCode, event);
  }
  </code></pre>
  
  <p>Thanks in advance.</p>