title: Unable to full screen activity when i use onAttachedToWindow
body: <p>I am trying to override home key and full screen the acitiy using  below code. locking of home key is working fine but it unable to hide notification bar  (unable to full screen the activity). </p>
  
  <pre><code>public class ScreenLockDemo extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.screenlock);
  
      }
  
  
  
  @Override
  public void onAttachedToWindow()
  {  
    this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
      super.onAttachedToWindow();  
  
  }
  
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
      // TODO Auto-generated method stub
      if(keyCode==KeyEvent.KEYCODE_BACK){
          return true;
      }
      if(keyCode==KeyEvent.KEYCODE_HOME){
          return true;
      }
  
      return super.onKeyDown(keyCode, event);
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>AndroidManifest.xml :</strong> </p>
  
  <pre><code> &lt;activity
          android:name="com.antivirus.antitheft.ScreenLockDemo"
           android:configChanges="touchscreen|keyboard|keyboardHidden|navigation|orientation"
          android:screenOrientation="portrait"
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
         &gt;              
      &lt;/activity&gt;
  </code></pre>
  
  <p>![out put of above code it cute the topside of layout as show in img. ][1]</p>
  
  <p>i am also trying to setType using handler it full screen the activity but it could not override menu key. please help me.</p>
  
  <p>Thanks in advance.</p>