title: How to create an appium android device "back button" in java
body: <p>Appium version is: 1.2.0.1</p>
  
  <p>I saw a few codes for that, like:</p>
  
  <pre><code>// click back button
  HashMap swipeObject = new HashMap();
  swipeObject.put("keycode", 82);
  ((JavascriptExecutor)driver).executeScript("mobile: keyevent", swipeObject);
  
  // click back button
  HashMap&lt;String, Integer&gt; keycode = new HashMap&lt;String, Integer&gt;();
  keycode.put("keycode", 4);
  ((JavascriptExecutor)driver).executeScript("mobile: keyevent", keycode);
  </code></pre>
  
  <p>But they don't work , any idea how ?  </p>