... Pause button?
<p>I have an android game that relies on touching the major areas of the screen, so I had initially implemented a system for pausing that relied on physical keys/buttons (press "up" to pause). I knew this was a bad idea, but was unsure as to how I might implement a touchable pause "button." Ideas?</p>

<p>Here is the code (onKeyDown toggles Overlay [my pause screen] in the level class):</p>

<pre><code>@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if ( event.getAction() == MotionEvent.ACTION_DOWN &amp;&amp; (
            keyCode == KeyEvent.KEYCODE_DPAD_UP ||
            keyCode == KeyEvent.KEYCODE_MENU
    ) ) {
        toggleOverlay();
        return true;
    } else
        return super.onKeyDown(keyCode, event);
}
</code></pre>
