I have an onClick method set in the xml layout file that triggers the vibration of the phone for 100ms at this point I have the ImageView Visibility set to visible so it can be seen. I want the ImageView to be set back to gone again when the vibration has stopped. How do I go about this?
Asked
Active
Viewed 4,779 times
1 Answers
11
You can start this method at the same time:
public void timerDelayRemoveView(float time, final ImageView v) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
v.setVisibility(View.GONE);
}
}, time);
}
-
You are welcome. You can animate the removal of your view by calling another method from here and passing your view as a parameter... to spice it up ;) – Lumis Jan 25 '11 at 15:56