Transparent activity not visible when we override home button action
<p>I am working in an android application and my scenario is to show a transparent activity above an activity and I have successfully implemented it in by adding  </p>

<p><code>android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"</code> </p>

<p>in my manifest in that activity. But also I want to override my android device hardware home button. So to that I have overridden the key events <code>dispatchKeyEvent</code> and <code>onAttachedToWindow</code> and I have successfully implemented that. But when I have overridden the home button keys this transparent activity is not visible. The code that I used to override the the home key events are </p>

<p>:</p>

<pre><code>@Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        onAttachedToWindow();

        if ((event.getKeyCode() == KeyEvent.KEYCODE_HOME)) {

            // if Home button is pressed EntryValidationActivity called
            SharescreenActivity.this.finish();
            Intent screenLockIntent = new Intent(SharescreenActivity.this,
                    EntryValidationActivity.class);
            startActivity(screenLockIntent);
            this.moveTaskToBack(true);
            return true;
        } else
            return super.dispatchKeyEvent(event);
    }


 @Override
    public void onAttachedToWindow() {

        this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
        //this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onAttachedToWindow();

    }
</code></pre>

<p>Any solution to work these both together. 
Thanks in Advance.</p>
