Android back key by software
<p>Dows anybody know how I can simulate pressing the back key by software? I've seen some applications which simulate this key and a few other keys like home and search. But because theese weren't open source, I tried to build my own application which can manage theese tasks. To go back to home for example is very easy because I had to send just one intent. So... what can I do to simulate the back key? :)</p>

<p>UPDATE:</p>

<p>I've downloaded an open source application which has the same functions from <a href="http://git.hoopajoo.net/" rel="nofollow">http://git.hoopajoo.net/</a></p>

<p>There it's done like that:</p>

<pre><code>Process process = Runtime.getRuntime().exec("su");
OutputStream outputStream = process.getOutputStream();
String cmd = "keycode " + KeyEvent.KEYCODE_BACK;
outputStream.write((cmd + "\n").getBytes("ASCII"));
</code></pre>

<p>Where does the "keycode" command come from? I could not found any so called binary in my Android rootfs?!?!</p>
