ImageButton inherits View, so you can always use:
imageButton.setVisibility (View.INVISIBLE);
To disappear a view after x time, you can use a handler
Handler handler = new Handler();
handler.postDelayed( new Runnable() {
public void run(){
imageButton.setVisibility(View.INVISIBLE);
}
}, 5000);
Make sure you call this after the whole view is complete and after setContentView or onViewCreated (for fragments) is called
source
share