Android: show white background when search button pressed
<p>When I press the search key on my device, I want it to show a white background. However, when I press the back button, I want the previous activity's background to be restored. <code>ivBackground</code> is a variable I added to my relativelayout which I turn VISIBLE to show the white background.</p>

<pre><code> public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_SEARCH) {
        ivBackground.setVisibility(View.VISIBLE);//WHITE IMAGEVIEW
        return false;
    } else if (keyCode == KeyEvent.KEYCODE_BACK) {
        ivBackground.setVisibility(View.GONE);
        return true;
    }
    return super.onKeyDown(keyCode, event);
 } 
</code></pre>

<p>While the above code works, the problem is that when I press the back button, the white screen still remains. It only goes away if I press the back button once again. Any solutions?</p>
