Handler in Android Project : Thread Safe
<p>I am using Handler in an android project to give a callback to to the main/ui thread.</p>

<pre><code>        if (mHandler == null) {
            mHandler = new Handler(Looper.getMainLooper());
        }
        mHandler.post(new Runnable() {
            public void run() {
                freeBeePlaybackEventListener.onError(freeBeeError);
            }
        });
</code></pre>

<p>When I am creating the handler object i.e. mHandler , I am checking whether the handler already exists or not. If not, then I am creating the handler i.e. using a singleton pattern. My question is: Is creation of the handler object thread safe ?</p>

<p>Thanks.</p>