Reputation: 620
I want to set an action or do something like change button background when click outside of the PopupWindow
.
Here marked default button color:-
Here marked changed button color after click:-
After clicking outside of the PopupWindow
, I want to change my button background to default.
How can i do that? I need some help.
Upvotes: 2
Views: 426
Reputation: 2528
Use an OnDismissListener
for your PopupWindow
:
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
// Change the icon
}
});
Where popupWindow
is the PopupWindow
you are displaying.
Upvotes: 1