diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 3550dcb..3cef002 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -118,6 +118,7 @@
     private int mPopupPreviewDisplayedY;
     private final int mDelayBeforePreview;
     private final int mDelayAfterPreview;
+    private ViewGroup mPreviewPlacer;
 
     // Popup mini keyboard
     private PopupWindow mMiniKeyboardPopup;
@@ -898,22 +899,35 @@
         }
     }
 
-    // TODO: Introduce minimum duration for displaying key previews
-    // TODO: Display up to two key previews when the user presses two keys at the same time
-    private void showKey(final int keyIndex, PointerTracker tracker) {
-        // If the preview popup has no parent view yet, add it to the screen FrameLayout.
-        if (mPreviewText.getParent() == null) {
-            final FrameLayout screenContent = (FrameLayout) getRootView()
-                    .findViewById(android.R.id.content);
-            if (android.os.Build.VERSION.SDK_INT >= /* HONEYCOMB */ 11) {
-                screenContent.addView(mPreviewText, new FrameLayout.LayoutParams(0, 0));
+    private void addKeyPreview(TextView keyPreview) {
+        ViewGroup placer = mPreviewPlacer;
+        if (placer == null) {
+            final FrameLayout screenContent = (FrameLayout) getRootView().findViewById(
+                    android.R.id.content);
+            if (android.os.Build.VERSION.SDK_INT >= /* HONEYCOMB */11) {
+                placer = screenContent;
             } else {
                 // Insert LinearLayout to be able to setMargin because pre-Honeycomb FrameLayout
                 // could not handle setMargin properly.
-                final LinearLayout placer = new LinearLayout(getContext());
+                placer = new LinearLayout(getContext());
                 screenContent.addView(placer);
-                placer.addView(mPreviewText, new LinearLayout.LayoutParams(0, 0));
             }
+            mPreviewPlacer = placer;
+        }
+        if (placer instanceof FrameLayout) {
+            placer.addView(keyPreview, new FrameLayout.LayoutParams(0, 0));
+        } else {
+            placer.addView(keyPreview, new LinearLayout.LayoutParams(0, 0));
+        }
+    }
+
+    // TODO: Introduce minimum duration for displaying key previews
+    // TODO: Display up to two key previews when the user presses two keys at the same time
+    private void showKey(final int keyIndex, PointerTracker tracker) {
+        // If the preview popup has no parent view yet, add it to the ViewGroup which can place
+        // key preview absolutely in SoftInputWindow.
+        if (mPreviewText.getParent() == null) {
+            addKeyPreview(mPreviewText);
         }
 
         final Key key = tracker.getKey(keyIndex);
