Using a new thread to post to observers I have implemented my own Observer pattern. I want to post my events in a new thread. This thread would simply call all the the observers/listeners with the posted event.

public class EventManager
{
    private ArrayList&lt;Observer&gt; observerList = new ArrayList&lt;&gt;();

    public void post(Object event)
    {
       new Thread(new MyRunnable(this, event)).start();
    }

    public void postHelper(Object event)
    {
        for(int i = 0; i &lt; observerList.size(); i++)
        {
            Observer observer = observerList.get(i);
            observer.handle(event);
        }
    }


    private static class MyRunnable implements Runnable
    {
        EventManager eventManager;
        Object event;

        public MyRunnable(EventManager eventManager, Object e)
        {
            this.eventManager = eventManager;
            event = e;
        }

        @Override
        public void run()
        {
            eventManager.postHelper(event); 
        }
    }
}

public interface Observer
{
    void handle(Object event);
}


How can I improve this? My main concern is that I am creating a thread everytime, which could potentially leave me out of memory.
You can limit the number of threads you're using via a thread pool. For example:

public class EventManager { 
    private static ExecutorService pool = Executors.newFixedThreadPool(8);
    [....]


and then use it like so:

pool.execute(new MyRunnable(this, event));


You should also take care of shutting down the pool when/if you dispose the EventManager.
For further information check the API docs (Android in your case).