tags:

views:

56

answers:

3

Hi,

I have 1 imageButton and i want to hide that button after 5sec in oncreate method.Can anyone plz help me

Regards Mona

+1  A: 

imageButton.setVisible(View.INVISIBLE); or imageButton.setVisible(View.GONE);

A: 

ImageButton inherits from View so you can always use:

imageButton.setVisibility(View.INVISIBLE);

Necronet
+2  A: 
onCreate(){
  new SleepTask().execute();
}

private class SleepTask extends AsyncTask{
  protected void doInBackground(){
    Thread.sleep(5000);
  }
  protected void onPostExecute(){
    yourImageButton.setVisiblity(View.INVISIBLE);
  }
}
bhups