title: Run function when press on back button - android
body: <p>I want to run a function by pressing the back button of <code>Android</code></p>
  
  <p>I use in PhoneGap - 2.2.0 : <a href="http://docs.phonegap.com/en/1.0.0/phonegap_events_events.md.html#backbutton" rel="nofollow"><strong>BackButtonEvent</strong></a></p>
  
  <p>I tried to do it in the following way:</p>
  
  <pre><code>document.addEventListener("backbutton",RunBack, false);
  
  function RunBack() {
      alert('RunBack');
  }
  </code></pre>
  
  <p>also:</p>
  
  <pre><code>document.addEventListener("backbutton", function (e) {RunBack();}, false);
  </code></pre>
  
  <p>also:</p>
  
  <pre><code>document.addEventListener("backKeyDown", function (e) {RunBack();}, false);
  </code></pre>
  
  <p><strong>Why is it not working?</strong></p>