实际情况是你按照 一般的 findViewbyId(R.id.orientation_layout); 已经得不到 ID了,会报空指针的
popup = new PopupWindow(this); View popView = LayoutInflater.from(this).inflate(R.layout.listings_search, null);
所以 你在得到ID的时候应该 加上 PopupWindow 布局view的引用
orientationLayout = (FlowTagLayout) popView.findViewById(R.id.orientation_layout);