1.主要代码:
声明:
private View shareView;
private PopupWindow pop;
在onCreate方法里:
// 引入窗口配置文件
shareView = LayoutInflater.from(this).inflate(
R.layout.jyx_activity_share, null);
// 创建PopupWindow对象
pop = new PopupWindow(shareView, LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT, false);
// 需要设置一下此参数,点击外边可消失
pop.setBackgroundDrawable(new ColorDrawable());
// 设置点击窗口外边窗口消失
pop.setOutsideTouchable(true);
pop.setAnimationStyle(R.style.AnimationPreview);
// 设置此参数获得焦点,否则无法点击
pop.setFocusable(true);
pop.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss() {
ShareSDK.stopSDK(Pr