1

I know there's android's source code. But how to find an implementation or subclass of some specific interfaces or abstract classes, like FragmentManager? It's annoying and upset when you're digging into source code to find bugs or try to understand how things work but only arrive at interfaces and abstact classes.

Thanks for share.

Update: OK, I find there's a inner class in FragmentManager that inherits it. But what about others, like context, some services? Maybe google helps sometimes, but what if it can't?

Self conclusion: Official API reference lists public sub-classes. If private or package-private are expected, they are supposed to be in same package or class file.

azizbekian
  • 60,783
  • 13
  • 169
  • 249
Lym Zoy
  • 951
  • 10
  • 16
  • You may use jgrep from AOSP, to grep in Java source code. Quite useful when you don't have AOSP code in an IDE – Mixaz Oct 24 '17 at 20:30

1 Answers1

4

Just perform a search in android sources using Android Studio search. Particularly in this case you are interested in classes that extend from FragmentManager, which means, that you are searching for "... extends FragmentManager" through the sources:

enter image description here

Check "Directory" radio button and "Recursively" checkbox, pointing out path to sdk in the box.

Then in preview window you'll get prompted with matches:

enter image description here

You can also see an example of more specific search using regex in this answer.

azizbekian
  • 60,783
  • 13
  • 169
  • 249