Reputation: 73753
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?
Upvotes: 586
Views: 192333
Reputation: 91
Here is the information I've organized from each answer. Thanks to everyone for their contributions.
Shortcut: Ctrl + Q (macOS: Command + J)
setting:
- Disable support for screen readers
Appearance & Behavior > Appearance > Support screen readers
- Tooltip delay time
Set a reasonable delay time
Editor > Code Editing > Tooltip delay
setting:
Editor > Code Completion > Show the documentation popup
Shortcut: Ctrl + P
Shortcut: Ctrl + Space (Windows might conflict with some language input methods, switch to full English)
Shortcut: Ctrl + J
refer to the official JetBrains standard shortcuts at: https://resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf
Upvotes: 0
Reputation: 2119
On Mac OS:
Preferences -> Editor -> Code Editing -> Quick Documentation -> Show quick documentation on hover
Upvotes: 1
Reputation: 3986
For Android Studio 4.1 and 4.2, this checkbox has moved under Editor → General → Code Completion.
Upvotes: 6
Reputation: 16632
I'm using Visual Studio too much and I want to see parameters when I click on Ctrl + Space. That's why I'm using Visual Studio keys.
To change the keymap to the Visual Studio keymap:
Upvotes: 0
Reputation: 683
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.
Upvotes: 20
Reputation: 11114
MacBook: ⌘ + J or Fn + F1 does the same.
Also, use the one from the editor definition as explained above.
Upvotes: 2
Reputation: 555
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.
Upvotes: 2
Reputation: 693
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):
Upvotes: 32
Reputation: 72553
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 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.
Upvotes: 959
Reputation: 5144
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.
Upvotes: 125
Reputation: 1585
Go to Editor → Preference → Editor → General and choose Show quick doc on mouse hover!
Upvotes: 7
Reputation: 22527
Android Studio 2.x.x
Moved under menu Editor → General
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.
Upvotes: 16
Reputation: 8495
On my Mac, CtrlF1 stopped working, but F1 on its own works.
Upvotes: 7
Reputation: 700
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.
Upvotes: 14
Reputation: 9997
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
Upvotes: 12
Reputation: 1018
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.
Upvotes: 7