私はそれの中にトウボタンを持つPopupWindowを持っています。彼らは期待どおりに動作し、押したままにすると押した状態になり、アクションを実行します。問題は、すぐにボタンを押して放してしまうことです。これにより、ボタンは透明になり、PopupWindowの背景も表示されます。これは、ユーザーがクリックしてそれを保持していない場合にのみ発生します。これを引き起こしている可能性のあるアイデアは何ですか?問題は、この2行だったPopupWindowのボタンは、すばやくクリックすると透明になりますか?
final String path = argpath;
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.productpopup, null, false);
ImageView iv = (ImageView) layout.findViewById(R.id.big_product_image);
TextView tv = (TextView)layout.findViewById(R.id.productDescription);
if (fullDescription.equals(""))
tv.setVisibility(View.GONE);
else
tv.setText(fullDescription);
if (iv != null && imageID != ImageManager.NOIMAGE) {
iv.setImageResource(imageID);
popup = new PopupWindow(layout,
LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT,
true);
BitmapDrawable bm = new BitmapDrawable();
popup.setBackgroundDrawable(bm);
popup.setOutsideTouchable(true);
popup.setAnimationStyle(android.R.style.Animation_Toast);
popup.showAtLocation(getWindow().getDecorView(), Gravity.CENTER, 0, 0);
Button closeButton = (Button) layout.findViewById(R.id.close);
Button orderButton = (Button) layout.findViewById(R.id.order);
closeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
popup.dismiss();
}
});
if (!path.equals("")) {
orderButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (path != null)
startActivity(routeTo(path));
popup.dismiss();
}
});
}
}
コードを投稿できますか? – slayton