summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-09-18 15:39:05 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-18 15:39:05 -0700
commitd413eb3861aae87386d418e9af4875f6f330cd05 (patch)
treed56e580e2085681f3a074d8d560b47e1596a22aa /core/java/android
parentce801c4a1b1137ca2fd51ede6818722793c79ea4 (diff)
parent8ee6d7c20e7767c2f61f8db9a99d01e0a05f3842 (diff)
Merge "Fix bug 5333962 - Problems with no action bar/overlay action mode"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/widget/PopupWindow.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index 4d45c2fee094..aac20c4434ad 100644
--- a/core/java/android/widget/PopupWindow.java
+++ b/core/java/android/widget/PopupWindow.java
@@ -796,6 +796,21 @@ public class PopupWindow {
* @param y the popup's y location offset
*/
public void showAtLocation(View parent, int gravity, int x, int y) {
+ showAtLocation(parent.getWindowToken(), gravity, x, y);
+ }
+
+ /**
+ * Display the content view in a popup window at the specified location.
+ *
+ * @param token Window token to use for creating the new window
+ * @param gravity the gravity which controls the placement of the popup window
+ * @param x the popup's x location offset
+ * @param y the popup's y location offset
+ *
+ * @hide Internal use only. Applications should use
+ * {@link #showAtLocation(View, int, int, int)} instead.
+ */
+ public void showAtLocation(IBinder token, int gravity, int x, int y) {
if (isShowing() || mContentView == null) {
return;
}
@@ -805,7 +820,7 @@ public class PopupWindow {
mIsShowing = true;
mIsDropdown = false;
- WindowManager.LayoutParams p = createPopupLayout(parent.getWindowToken());
+ WindowManager.LayoutParams p = createPopupLayout(token);
p.windowAnimations = computeAnimationResource();
preparePopup(p);