I have a view inflated from a layout that i need to hide if it gets clicked, so i have
mViewBar.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//Code to remove the view
}
});
but this view has some child views, i also need to catch click events on them, how do i do this the clean way ?
To hide inflated layout.
Get parent view id of inflated view and all other child view id’s.
register for click listener for each view.
Don’t remove the whole view just set its visibility.