How can i send message to handler from a static function?
<p>I know, this is again a repeated question but my case it is different question.</p>

<p>I have a class abc with a static function &amp; a Handler. Earlier i couldn't able call handler from a static function. Then i googled for <strong>Access a non-static function from a static function</strong> &amp; found an solution is to create an instance of class &amp; access non-static variable. But now, why, i m getting this error.</p>

<p><strong><code>E/AndroidRuntime(13343): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</code></strong></p>

<pre><code>public class abc
 {    
    static public void Instantiate()
    {
         abc xyz = new abc();
         xyz.handler.sendEmptyMessage(1);      **//GETTING ERROR IN THIS LINE**
    }

    public Handler handler = new Handler() 
        {
                public void handleMessage(Message msg) 
                {
                        switch (msg.what)
                        {
                        }
                 }
        }

}
</code></pre>

<p><strong>My Question: How can i send message to <em>handler</em> from a static function?</strong></p>

<p><strong>Thankx.</strong></p>
