Take the 2-minute tour ×

For example, say the main Activity has an custom object foo with a method called bar. When foo.bar() is called via the activity, it does a bunch of things on a thread and when it is finished it would somehow alert the main ui thread, the activity, it's parent that it is finished.

I imagine this working the same way an event like a OnClickListener works. The bar() method would trigger an event saying "Hey I'm finished" and that would trigger the listener on the main activity.

Hope that makes sense.

Thanks for your help!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You basically need the observer pattern. You can read Design Patterns Uncovered: The Observer Pattern

share|improve this answer
That's exactly what I was looking for. Thank you. –  cottonBallPaws Sep 12 '10 at 1:18
add comment

Your Answer


