Android use callback between activity and dialog
===

I have dialog with search functionality. From main activity I call dialog and do some work on user interaction. During dialog showing I have to call some code in main activity. Is it goog idea to use callback or have to use handler?