How to view method information in Android Studio
Android StudioAndroid ViewAndroid Studio Problem Overview
In Eclipse, when you hover your mouse over a method, a window would appear with a description of what the method does, what the parameters mean and what it returns. Is there a way to get Android Studio to do the same thing?
Android Studio Solutions
Solution 1 - Android Studio
The easiest and the most straightforward way:
To activate: menu File → Settings → Editor → General
For Mac OS X, Android Studio → Preferences → Editor → General and check Show quick documentation on mouse move:
Other ways:
-
You can go into your IntelliJ IDEA's bin folder and search for idea.properties. Add this line to the document:
auto.show.quick.doc=true
Now you'll have the same floating documentation window like in Eclipse.
- You have to press Ctrl + Q to see the Javadoc.
You can pin the window and make the documentation appear every time you select a method with your mouse though.
Android Studio 1.0: You have to hold Ctrl if you want to get hold of the documentation window, for example, scrolling documentation. Otherwise, as you move your mouse away from the method, the documentation window will disappear.
Solution 2 - Android Studio
Yes, you can. Go to menu File → Settings → Editor → Show quick documentation on mouse move
Or, in Mac OS X, go to Android Studio → Preferences → Editor → General → Show quick doc on mouse move.
Solution 3 - Android Studio
It comes very handy if you create a keymap for functionalities you use very frequently. By default (if you select an OS X v10.5 (Leopard) and later keymap):
- Ctrl + P: To see what parameters are expected by the function
- Command + J: To see the documentation
- Ctrl + Space: To see the autocomplete suggestions
Solution 4 - Android Studio
In addition to the answers here, you might want to make sure that the documentation is downloaded. To do that, go to SDK Manager:
And then the SDK Tools tab and make sure Documentation for Android SDK is installed.
If it isn't, check the box and click Apply.
Solution 5 - Android Studio
Android Studio 2.x.x
Moved under menu Editor → General
Older Versions
Using Windows 7 and Android Studio 1.0.x it took me a while to figure out the steps provided in the answer.
To help further visitors save some time, here is the way I did it:
Go to menu File → Settings or press Ctrl + Alt + S.
The following window will open and check Show quick doc on mouse move under IDE Settings → Editor.
Or just press Ctrl and hover your move over your method, class, etc.
Solution 6 - Android Studio
If you just need a shortcut, then it is Ctrl + Q on Linux (and Windows). Just hover the mouse on the method and press Ctrl + Q to see the doc.
Solution 7 - Android Studio
>If you need only Parameter info then:
On Mac, it's assigned to Command+P
On Windows, it's assigned to Ctrl+P
> If you need document info then:
On Mac, it's assigned to Command+Q
On Windows, it's assigned to Ctrl+Q
Solution 8 - Android Studio
Solution 9 - Android Studio
On Mac the default key combination for showing the quick documentation is: CTRL + F1
The cursor has to be on the method when using this.
Solution 10 - Android Studio
On my Mac, CtrlF1 stopped working, but F1 on its own works.
Solution 11 - Android Studio
Solution 12 - Android Studio
Many of the other answers are all well, but if you want an informational tooltip instead of a full-blown window then do this: after enabling it using Ahmad's answer then click on the little pin on the upper right corner:
After this the method information will appear on a tooltip like almost every other mainstream IDE.
Solution 13 - Android Studio
MacBook: ⌘ + J or Fn + F1 does the same.
Also, use the one from the editor definition as explained above.