Is it possible to get the listener that is attached to a view if it exists ? for example if i have a view i would like to get the listener that is listening to that view if there exists one
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The only method I could find is View.getOnFocusChangeListener(). So a standard-library
Viewwill only tell you about itsOnFocusChangeListener; for other listeners, no such getters are part of the class, so if you want to introduce those, you may have to subclass View.Also, there are some methods that tell you whether a specific type of listener is attached to the
Viewwithout returning the listener, for example whether a drag event listener, an on click listener or an on long click listener is attached to theView. Note: some of these methods may have side effects, check the docs on that.