View contentView = LayoutInflater.from(context).inflate(R.layout.popup_layout, null);
popupWindow.setContentView(contentView);
popupWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
popupWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
contentView.measure(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
int width = contentView.getMeasuredWidth();
int height = contentView.getMeasuredHeight();
이전 프로젝트에서 저는 이렇게 가져다가 썼었네요..