Reputation: 36028
I am trying to create and display a PopupWindow
:
private void setupPopupWindow() {
TextView popTextView = new TextView(this);
popTextView .setText("xxxxxxxxxxxxx");
mPopupWindow = new PopupWindow(popTextView );
mPopupWindow.setTouchable(true);
mPopupWindow.setOutsideTouchable(true);
mPopupWindow.showAtLocation(anotherViewInMyActivity, Gravity.CENTER, 120, 120);
}
But the popupwindow
does not show.
Did I miss anything?
Upvotes: 0
Views: 96
Reputation: 676
Try to set size for your TextView
.
setWidth(120);
setHeight(120);
If popup window will ignore outside touches, just set background
setBackgroundDrawable(new ColorDrawable(Color.WHITE));
Upvotes: 2