1

In my layout i have two views at bottom like this

enter image description here

color view and buttons view i want replace the button view after 5 seconds with color view ( button view hide) , if user press button i want display the button view at the same place , color view moves to top of button view . how can i achieve this. please help me..

NagarjunaReddy
  • 8,621
  • 10
  • 63
  • 98

1 Answers1

2
new Handler().postDelayed(new Runnable() {          
  public void run() {
      ButtonView.setVisibility(View.GONE);      
      }
}, 5000);
RajaReddy PolamReddy
  • 22,428
  • 19
  • 115
  • 166
Umesh
  • 4,406
  • 2
  • 25
  • 37
  • after button view hide color view goes to top of the view , here i am using relative layouts. – NagarjunaReddy Nov 26 '11 at 06:12
  • RelativeLayout might be a problem here. add both the layouts in a vertical linearlayout. the code will work just fine. Also add a bit of code that you've tried so far. that might help us find the problem – Umesh Nov 26 '11 at 06:15
  • see the [link](http://stackoverflow.com/questions/2963152/android-how-to-resize-a-custom-view-programmatically) and u'll find how to resize the view programmatically. – himanshu Nov 29 '11 at 07:18