Where should Android PopupWindow event handlers go?
<p>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. </p>

<p>My PopupWindow has a button and currently the onClick handler for that button is in the same Activity thats launched the popup.</p>

<p>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.    </p>

<p>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?  </p>

<p>Thanks in advance! </p>
