Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android and respondsToSelector:

Is there an Android analogue of the respondsToSelector: method from Objective C?

like image 478
SK9 Avatar asked Aug 03 '26 02:08

SK9


1 Answers

In Java you usually expect some interface where the method is defined. So you have the guarantee, that the object passed implements the method.

If you absolutely need the dynamic nature, use Java's reflection.

like image 91
Johannes Weiss Avatar answered Aug 05 '26 15:08

Johannes Weiss