title: How to use onKeyDown method in Fragment
body: <p>I've two Fragments. both of them have a list of some audio files. when and audio is playing a seekBar will pop up, and when media is finished sekkBar will slide down and hide.</p>
  
  <p>Now I've decided for a better view if a user wants to hide the seekBar during playing the media, show_and_hide the seekBar with hardware MENU_KEY in both Fragments separately.</p>
  
  <p>I'm doing it like this but it is not working:</p>
  
  <pre><code>view = inflater.inflate(R.layout.light_fragment_main, container, false);
  
          view.setOnKeyListener(new View.OnKeyListener(){
          public boolean onKey(View v, int keyCode, KeyEvent event) {
              if (keyCode == KeyEvent.KEYCODE_MENU) {
                  boolean check = true;
  
                  if (mediaPlayer.isPlaying()){
  
                      if (check){
                          toast("slide DOWN");
                          check = false;
                        }
  
                  else {
                          toast("slide UP");
                          check = true;
                  }
  
  
              }
  
  
                  return true;
  
              }
              return false;
          }
  
      });
  </code></pre>
  
  <p>Am I doing it wrong?</p>