sandeor30r
sandeor30r

Reputation: 25

Can I determine which library class belong?

I have for example class LivePagedListProvider that that is in the android.arch.paging package.

Is there any direct way to determine which library in gradle file this class belongs to?

Upvotes: 2

Views: 1429

Answers (3)

Richard Le Mesurier
Richard Le Mesurier

Reputation: 29713

You can do this in Android Studio, by using the Navigate... Class menu option (or pressing CTRL-N on Windows).

Press CTRL-N, and when the search box opens up, start typing the name of the class you want to find.

CTRL N search for class

As the matches are shown in the list below, to the right of each match will be shown which gradle dependency this class belongs to.


If you choose to open the class, then in the top left of your screen you will also see the name of the library.

showing library that class is in

This is useful because it lets you navigate around that JAR file, by clicking the various parts of the package name, but does not give you the full gradle dependency which is shown in the search box above.

Upvotes: 7

karan
karan

Reputation: 8843

A faster way I prefer is to use Search Everywhere box. Double tap shift key and in dialog that opens you can type your class name and its gradle dependency will be shown next to class name in suggestion drop-down.

Upvotes: 1

touhid udoy
touhid udoy

Reputation: 4444

Not sure you can say its the easy way, but it works for me.

For Mac, cmd+ Click (control + Left Click for Windows ) on that Class(not object) will take you to the declaration, where the Class actually exists.From that Class' package name, you can confidently tell which gradle project implementation that belong to, as both of them will be same.

Upvotes: -1

Related Questions