Code example for PopupWindow

Methods: setContentViewsetHeightsetWidthsetWindowLayoutMode

0
	private PopupWindow mPopup;
	private int popupStatus;
 
	public void makePopupWindow(View v) {
		if (mPopup == null) {
			mPopup = new PopupWindow(context);
		} 
		v.setBackgroundColor(Color.argb(0, 0, 0, 0));
		mPopup.setWindowLayoutMode(LayoutParams.WRAP_CONTENT,
				LayoutParams.WRAP_CONTENT);
		mPopup.setWidth(LayoutParams.WRAP_CONTENT);
		mPopup.setHeight(LayoutParams.WRAP_CONTENT);
		mPopup.setContentView(v);
		v.getRootView().setBackgroundColor(Color.argb(0, 0, 0, 0));
	} 
 
	public void showPopupWindow(int x, int y) {
//		x = 200; y = 200; 
		if (mPopup.isShowing()) {
			View v = mPopup.getContentView();
Connect your IDE to all the code out there  Get Codota for Java