Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view method information in Android Studio

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?

like image 360
tyczj Avatar asked May 18 '13 00:05

tyczj


People also ask

Where is the method in Android Studio?

Here's where Android Studio comes to the rescue. Just press CTRL+Space on Windows or Command+Space on Mac and you will be presented with a popup of all the variants of a method and the arguments that it expects.

How do you call a method in Android?

To call a method in Java, you type the method's name, followed by brackets. This code simply prints “Hello world!” to the screen. Therefore, any time we write helloMethod(); in our code, it will show that message to the screen.


1 Answers

The easiest and the most straightforward way:

To activate: menu FileSettingsEditorGeneral

For Mac OS X, Android StudioPreferencesEditorGeneral and check Show quick documentation on mouse move:

Settings dialog with checked option


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.

like image 172
Ahmad Avatar answered Oct 01 '22 23:10

Ahmad