Best code examples for Android PopupWindow class (android.widget.PopupWindow)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android PopupWindow class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android PopupWindow examples from Open Source projects
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
77:	this.window.setBackgroundDrawable(new BitmapDrawable()); 
-
85:	this.window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
86:	this.window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
87:	this.window.setTouchable(true); 
88:	this.window.setFocusable(true); 
89:	this.window.setOutsideTouchable(true); 
-
91:	this.window.setContentView(this.root); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
76:	this.window.setBackgroundDrawable(this.background); 
-
82:	this.window.setWidth(WindowManager.LayoutParams.FILL_PARENT); 
83:	this.window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
84:	this.window.setTouchable(true); 
85:	this.window.setFocusable(true); 
86:	this.window.setOutsideTouchable(true); 
-
88:	this.window.setContentView(this.root); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
82:	mWindow.setBackgroundDrawable(new BitmapDrawable()); 
-
87:	mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
88:	mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
89:	mWindow.setTouchable(true); 
90:	mWindow.setFocusable(true); 
91:	mWindow.setOutsideTouchable(true); 
-
93:	mWindow.setContentView(root); 
Full Snippet Info
8
CodeRank
Examples using Android PopupWindow setFocusable method:
This code example shows how to use the following methods: setFocusable, isFocusable
64:	popupWindow.setFocusable(true); 
-
66:	assertTrue(popupWindow.isFocusable()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
74:	mWindow.setBackgroundDrawable(new BitmapDrawable()); 
-
78:	mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
79:	mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
80:	mWindow.setTouchable(true); 
81:	mWindow.setFocusable(true); 
82:	mWindow.setOutsideTouchable(true); 
-
84:	mWindow.setContentView(mRootView); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
156:	mWindow.setBackgroundDrawable(new BitmapDrawable()); 
-
160:	mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
161:	mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
162:	mWindow.setTouchable(true); 
163:	mWindow.setFocusable(true); 
164:	mWindow.setOutsideTouchable(true); 
-
166:	mWindow.setContentView(mView); 
Full Snippet Info
7
CodeRank
Examples using Android PopupWindow setContentView method:
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
76:	window.setBackgroundDrawable(background); 
-
83:	window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
84:	window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
85:	window.setTouchable(true); 
86:	window.setFocusable(true); 
87:	window.setOutsideTouchable(true); 
-
89:	window.setContentView(root); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
77:	this.window.setBackgroundDrawable(this.background); 
-
84:	this.window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
85:	this.window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
86:	this.window.setTouchable(true); 
87:	this.window.setFocusable(true); 
88:	this.window.setOutsideTouchable(true); 
-
90:	this.window.setContentView(this.root); 
-
144:	this.window.showAsDropDown(this.anchor, xOffset, yOffset); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
71:	window.setBackgroundDrawable(new BitmapDrawable()); 
-
80:	window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
81:	window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
82:	window.setTouchable(true); 
83:	window.setFocusable(true); 
84:	window.setOutsideTouchable(true); 
-
86:	window.setContentView(root); 
Full Snippet Info
8
CodeRank
Examples using Android PopupWindow getContentView method:
This code example shows how to use the following methods: getContentView
161:	return onTouchInterceptor != null && onTouchInterceptor.onTouch(realPopupWindow.getContentView(), e); 
Full Snippet Info
7
CodeRank
Examples using Android PopupWindow dismiss method:
This code example shows how to use the following methods: dismiss, isShowing, setContentView, showAtLocation
160:	mContainer.setContentView(this); 
-
165:	mContainer.showAtLocation(mParent, 0, mContainerPositionX, mContainerPositionY); 
-
175:	mContainer.dismiss(); 
-
217:	if (mContainer.isShowing()) { 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: dismiss, setContentView
240:	mPopup.dismiss(); 
-
248:	mPopup.setContentView(null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: dismiss
49:	listWindow.dismiss(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setInputMethodMode
83:	mPopup = new PopupWindow(context, attrs, defStyleAttr); 
84:	mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED); 
Full Snippet Info
7
CodeRank
Examples using Android PopupWindow isShowing method:
This code example shows how to use the following methods: dismiss, isShowing, setContentView, showAtLocation
160:	mContainer.setContentView(this); 
-
165:	mContainer.showAtLocation(mParent, 0, mContainerPositionX, mContainerPositionY); 
-
175:	mContainer.dismiss(); 
-
217:	if (mContainer.isShowing()) { 
Full Snippet Info
7
CodeRank
Examples using Android PopupWindow setHeight method:
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
80:	window.setBackgroundDrawable(background); 
-
87:	window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
88:	window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
89:	window.setTouchable(true); 
90:	window.setFocusable(true); 
91:	window.setOutsideTouchable(true); 
-
93:	window.setContentView(rootView); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
76:	mWindow.setBackgroundDrawable(new BitmapDrawable()); 
-
80:	mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
81:	mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
82:	mWindow.setTouchable(true); 
83:	mWindow.setFocusable(true); 
84:	mWindow.setOutsideTouchable(true); 
-
86:	mWindow.setContentView(mRootView); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
56:	mWindow.setBackgroundDrawable(mBackground); 
-
58:	mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
59:	mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
60:	mWindow.setTouchable(true); 
61:	mWindow.setFocusable(true); 
62:	mWindow.setOutsideTouchable(true); 
-
64:	mWindow.setContentView(mRootView); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
56:	mWindow.setBackgroundDrawable(mBackground); 
-
58:	mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
59:	mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
60:	mWindow.setTouchable(true); 
61:	mWindow.setFocusable(true); 
62:	mWindow.setOutsideTouchable(true); 
-
64:	mWindow.setContentView(mRootView); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
70:	mWindow.setBackgroundDrawable(mBackground); 
-
72:	mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
73:	mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
74:	mWindow.setTouchable(true); 
75:	mWindow.setFocusable(true); 
76:	mWindow.setOutsideTouchable(true); 
77:	mWindow.setContentView(mRootView); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
75:	window.setBackgroundDrawable(new BitmapDrawable()); 
-
84:	window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
85:	window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
86:	window.setTouchable(true); 
87:	window.setFocusable(true); 
88:	window.setOutsideTouchable(true); 
-
90:	window.setContentView(root); 
Full Snippet Info
7
CodeRank
Examples using Android PopupWindow setTouchable method:
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
77:	this.window.setBackgroundDrawable(new BitmapDrawable()); 
-
84:	this.window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
85:	this.window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
86:	this.window.setTouchable(true); 
87:	this.window.setFocusable(true); 
88:	this.window.setOutsideTouchable(true); 
-
90:	this.window.setContentView(this.root); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
88:	window.setBackgroundDrawable(background); 
-
96:	window.setWidth(LayoutParams.WRAP_CONTENT); 
97:	window.setHeight(LayoutParams.WRAP_CONTENT); 
98:	window.setTouchable(true); 
99:	window.setFocusable(true); 
100:	window.setOutsideTouchable(true); 
-
102:	window.setContentView(root); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
83:	window.setBackgroundDrawable(new BitmapDrawable()); 
-
92:	window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
93:	window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
94:	window.setTouchable(true); 
95:	window.setFocusable(true); 
96:	window.setOutsideTouchable(true); 
-
98:	window.setContentView(root); 
Full Snippet Info
7
CodeRank
Examples using Android PopupWindow setWidth method:
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
91:	window.setBackgroundDrawable(background); 
-
98:	window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
99:	window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
100:	window.setTouchable(true); 
101:	window.setFocusable(true); 
102:	window.setOutsideTouchable(true); 
-
104:	window.setContentView(root); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
102:	window.setBackgroundDrawable(new BitmapDrawable()); 
-
111:	window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
112:	window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
113:	window.setTouchable(true); 
114:	window.setFocusable(true); 
115:	window.setOutsideTouchable(true); 
-
117:	window.setContentView(root); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
78:	this.window.setBackgroundDrawable(new BitmapDrawable()); 
-
86:	this.window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT); 
87:	this.window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); 
88:	this.window.setTouchable(true); 
89:	this.window.setFocusable(true); 
90:	this.window.setOutsideTouchable(true); 
-
92:	this.window.setContentView(this.root); 
Full Snippet Info
7
CodeRank
Examples for other Android PopupWindow methods:
Related Android PopupWindow Questions & Answers:
PopupWindow Class Overview
A popup window that can be used to display an arbitrary view. The popup window is a floa...
Methods
  • dismiss
    Dispose of the popup window.
  • getBackground
    Return the drawable used as the popup window's background.
  • getContentView
    Return the view used as the content of the popup window.
  • getHeight
    Return this popup's height MeasureSpec
  • getWidth
    Return this popup's width MeasureSpec
  • isShowing
    Indicate whether this popup window is showing on screen.
  • setHeight
    Change the popup's height MeasureSpec If the popup is showing, calling this method will take effect only the next time the popup is shown.
  • setInputMethodMode
    Control how the popup operates with an input method: one of INPUT_METHOD_FROM_FOCUSABLE, INPUT_METHOD_NEEDED, or INPUT_METHOD_NOT_NEEDED.
  • setOutsideTouchable
    Controls whether the pop-up will be informed of touch events outside of its window.
  • setWidth
    Change the popup's width MeasureSpec If the popup is showing, calling this method will take effect only the next time the popup is shown.
  • setWindowLayoutMode
    Change the width and height measure specs that are given to the window manager by the popup.
  • showAsDropDown
    Display the content view in a popup window anchored to the bottom-left corner of the anchor view offset by the specified x and y coordinates.
  • showAtLocation
    Display the content view in a popup window at the specified location.
  • update
    Updates the position and the dimension of the popup window.