onCreate:
setContentView(R.layout.main);
ImageView myiv=(ImageView)findViewById(R.id.myiv);
ImageView iv=new ImageView(this);
iv.setBackgroundResource(R.drawable.popup_up_bg);
final PopupWindow popuWindow = new PopupWindow(iv, ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
popuWindow.setOutsideTouchable(true);
myiv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
ColorDrawable cd = new ColorDrawable(-0000);
popuWindow.setBackgroundDrawable(cd);
popuWindow.showAsDropDown(v);
}
});