Make button go invisible after some time
<p>I Want to make the my Button go invisible or gone a few seconds after the activity is created. Using a thread gave me this error</p>

<p>The Error is in here :</p>

<pre><code>android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
</code></pre>

<p>Then I tried using a Handler, this gave me this error:</p>

<p>java.lang.RuntimeException: Unable to start activity <code>ComponentInfo{com.LstSearch/com.LstSearch.BasicMusicView}: java.lang.NullPointerException</code></p>

<p>So then I  tried using runOnUiThread(). If I execute this in onCreate(), the activity takes the amount of time as I have specified in the thread, and the image will go invisible after that much time. But when the activity starts after 3 seconds, the image has already turned itself invisible.
I think have found the Solution as a new entry they are not allowing me to answer me question so i am editing here</p>

<pre><code>handler=new Handler();
 Runnable r=new Runnable() 
{ public void run() 
{change image } 
};
 handler.postDelayed(r, 1000);
</code></pre>

<p>Cheers!!</p>
