当显示弹出窗口时,单击按钮不能显示哪个弹出窗口?
private void initiatePopupWindow(ScrollView sv) {
try {
if(popOpened){
pwindo.dismiss();
popOpened = false;
}
else{
pwindo = new PopupWindow(sv, LayoutParams.WRAP_CONTENT, 800, true);
pwindo.showAsDropDown(filterButton,30,30);
popOpened = true;
}
} catch (Exception e) {
e.printStackTrace();
}
}
filterButton.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View arg0) {
System.out.println("this is click of filter button:::");
if (filterProduct.isEmpty()) {
GetFilterWS task = new GetFilterWS();
task.execute();
} else {
initiatePopupWindow(sv);
}
}
});
显示弹出窗口时不打印System.out.println消息。
答案 0 :(得分:0)
您是否尝试过PopupWndow.setOutsideTouchable(true);