title: Android full screen layout position
body: <p>I got a problem with setting an action to full screen. When I set an action to full screen, the layout was shifted down, it does not draw from the top edge of screen. But it will be fix by itself when I press menu button and the menu shown.</p>
  
  <p>I set it to full screen by following code:
  <b>setTheme(android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);</b></p>
  
  <p>I also make the wallpaper can be visible and hide title bar. It was tested on android 2.1 and 2.2</p>
  
  <p><strong>simplified Code:</strong></p>
  
  <p>TestActivity.java :</p>
  
  <pre><code>package com.test.fullscreen;
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.WindowManager;
  
  public class TestActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
         setTheme(android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER);
  
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
      }
  }
  </code></pre>
  
  <p>main.xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
      &lt;EditText
          android:id="@+id/inputBox"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:background="#66303030"
          android:cursorVisible="true"
          android:hint="Text"
          android:paddingLeft="7dp"
          android:paddingRight="17dp"
          android:textColor="#ffffff"
          android:textSize="24dp" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.test.fullscreen"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk android:minSdkVersion="7" /&gt;
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name" &gt;
          &lt;activity
              android:label="@string/app_name"
              android:name=".TestActivity" &gt;
              &lt;intent-filter &gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Result:</p>
  
  <p><img src="https://i.stack.imgur.com/tX56B.jpg" alt="Result"></p>
  
  <p><strong>Update:</strong></p>
  
  <p>I found that if I replace the <code>EditText</code> to <code>TextView</code>, it works properly. If the EditText is the first <code>View</code> to show, the layout will be shifted down.</p>