1

How to get all classes which implement specified interface in Android? I think Classloader and Class classes should be used somehow..

Walking all loaded by classloader classes and checking, if it implements specified interface, is not good idea i suppose.

I've found similar question and perfect answers here: Find Java classes implementing an interface.

BUT Dalvik has some restrictions and i wonder which method is available on Android. Thanks.

Community
  • 1
  • 1
Anton
  • 1,903
  • 3
  • 16
  • 18

1 Answers1

1

Have a look at the Google reflections library. This would build and search an index of reverse reflection data (i.e. find subclasses instead of find super classes) and should provide what you want.

Thomas
  • 87,414
  • 12
  • 119
  • 157
  • Does not work( Can not be compiled: http://code.google.com/p/reflections/issues/detail?id=98&thanks=98&ts=1327489720 – Anton Jan 25 '12 at 11:09