private void showView(Context mContext) {
LayoutInflater mLayoutInflater = (LayoutInflater) mContext
.getSystemService(LAYOUT_INFLATER_SERVICE);
View music_popunwindwow = mLayoutInflater.inflate(
R.layout.music_popwindow, null);
mPopupWindow = new PopupWindow(music_popunwindwow,
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
mPopupWindow.showAtLocation(findViewById(R.id.mainn), Gravity.RIGHT
| Gravity.BOTTOM, 0, 44);
}
现在我这个弹出窗口里面是5个linearLayout 想监听linearLayout点击触发事件 该怎么做? 新手不会 求指教
LayoutInflater mLayoutInflater = (LayoutInflater) mContext
.getSystemService(LAYOUT_INFLATER_SERVICE);
View music_popunwindwow = mLayoutInflater.inflate(
R.layout.music_popwindow, null);
mPopupWindow = new PopupWindow(music_popunwindwow,
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
mPopupWindow.showAtLocation(findViewById(R.id.mainn), Gravity.RIGHT
| Gravity.BOTTOM, 0, 44);
}
现在我这个弹出窗口里面是5个linearLayout 想监听linearLayout点击触发事件 该怎么做? 新手不会 求指教
setOnClickListener()
+1,补充一下,5个LinearLayout要设置对应的ID,同时,如果出现事件覆盖的情况就做个事件冒泡处理。