Reputation: 583
I have a child view in my parent view. Now I am using animation to show child view for 10 sec and hide it after that. I want to show the child view even after 10 sec only if user touches it while animating. So how can I determine if the child view is touched by user or not? Does android provide any API to determine if view is touched by user at any instance of time?
Upvotes: 0
Views: 208
Reputation: 370
You can set the "clickable" property to true and setOnClickListener(). like this:
exampleView.setOnClickListener( new OnClickListener() {
@Override
public void onClick(View v) {
//TODO
}
});
You can also use the setOnTouchListener for more information on the "click".
Upvotes: 2