17

If I use Xcode or visual studio all I have to do is hover my mouse (Or alt + hover) to get more information about what the variable is returning or expecting. How can I do the same thing in android studio?

Do I have something toggled off or does android studio not support something like that?

3 Answers 3

18

It's ctrl + shift + p. You can customize it in File -> Settings -> Keymap -> View -> Expression Type.

18

One way I've found is simply placing the caret on the variable, and pressing F1. (Works with Flutter).

Alternatively, you can go to Settings->Editor->Code Editing and turn on Show quick documentation on mouse move.

2
  • 2
    I can't believe this is not the default setting
    – Andre Pena
    Jun 9, 2020 at 21:57
  • You made my life so much easier! Thanks a ton :) Jun 27, 2020 at 9:55
8

In newer versions of android studio it is "Ctrl + Hover"

EDIT
On variable declaration line using "Ctrl + Hover" will show "Usages of variable".
On later usage of the variable it will show you its correct data type.

2
  • Doesnt work. Shows the message: "Show usages of variable 'x'"
    – DarkNeuron
    May 14, 2019 at 13:28
  • @DarkNeuron It will only show that message if you CTRL + Hover over the variable name in variable declaration line because you already know the type of the variable during declaration right ? It will show the data type if you hover on later uses of that variable. Jun 19, 2019 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.