Button を含む PopupWindow を表示すると、ボタンをクリックできません。onclick を実行しますが、グラフィックは変更しません。
それはPopupWindowを示しています:
public void btn_friendsgame_newClick(View v) {
LayoutInflater layoutInflater =
(LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
View popupView = layoutInflater.inflate(R.layout.custom_dialog, null);
RelativeLayout content = (RelativeLayout) popupView.findViewById(R.id.layout_content);
Button b = new Button(this); // THIS BUTTON CAN'T CLICK!
b.setText("Test");
b.setLayoutParams(new LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
content.addView(b);
final PopupWindow popupWindow = new PopupWindow(popupView,
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
popupWindow.showAtLocation(this.findViewById(R.id.main), Gravity.CENTER, 0, 0);
Button close = (Button) popupView.findViewById(R.id.btn_popup_settings);
close.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
popupWindow.dismiss();
}
});
custom_dialog.xml: http://pastebin.com/dLivuE17
これを修復する方法は?