I’m using an Android PopupWindow in an application so I want to be sure I understand what “best practice” is for handing events from it.
My PopupWindow has a button and currently the onClick handler for that button is in the same Activity thats launched the popup.
But I’ve seen an example where someone created a class which extend PopupWindow. That’s the class they create when they need a PopUpWindow, but they still put the onClick handler in the Activity that launched it.
If I had a separate class like that, extending PopupWindow, would it be better to put the button handler in that class, and if so how would I do it?
Thanks in advance!
I don’t think it really matter. Personally, for legibility, I create a new class [file].