android studio auto complete: how to display constructors with parameters
Solution 1
Real answer to the Question:
It is also possible to show overloaded constructors by enabling a hidden option. Invoke the Help | Find Action
menu item and type Registry
to go to the Registry. Here enable the java.completion.show.constructors
option.
Copied From: https://stackoverflow.com/a/43639241/2920861
Solution 2
I usually start with Ctrl+P
to see what arguments are accepted (auto guess complete is way to error prone in my opinion). And if as in your case you want to fill in name type n a dropdown
menu appears with all available variables/fields
(etc) starting with n Arrow Up/Down
and Tab to select name, or Ctrl+Space
to select a method (or even Ctrl+Alt+Space
to be killed by suggestions;-), followed by , and v Tab for value.
File --> Keymap --> Main Menu --> Parameter Info --> Right Click --> Add keyboard short cut
I dont know whether it is added advantage or not while creating a constructor (ctrl+shift+space) will give default constructor after that cursor stays within the parenthesis gives all parametrized constructor of a particular class without any short cut :)
in eclipse ctrl+space with give you all the constructors of class
in android studio no need short cut key :)
You Can Use Eclipse Short Cut Keys in Android Studio Follow Below Process : File -- > Settings -- > Keymap ---> under Keymaps Drop down Select Eclipse option
Cheers
Solution 3
After writing default constructor, press Ctrl+P
. You will see list of possible parameters that can be fill in constructor.
Eng. Samer T
Updated on July 18, 2022Comments
-
Eng. Samer T almost 2 years
The auto Complete in eclipse displays all constructors with parameters, but Android studio doesn't.
For example see the following screenshot in eclipse, it displays all constructors of Intent class.
While auto complete in android studio for Intent class is displayed without parameters as following.
How to change auto complete in android studio to display all constructors with parameters ?
-
Eng. Samer T almost 9 yearsthanks, I appreciate you replying, however I do not want to straggle what shortcut is in a sequence of shortcuts. I ask if there is any way to make ctrl+space in android studio acts just like ctrl+space act in eclipse and display all constructors with parameters. I want to see all possibilities as options then I will choose the needed one. is it possible?
-
Daniel Hári over 7 yearsCTRL+P wants to print!
-
Daniel Hári over 7 yearsHow it makes visible the constructors?
-
Bevor over 7 years@DanielHári Go to settings of Android Studio and change the shortcut.
-
Bevor over 7 yearsThanks, although this is not an alternative, only a poor workaround. But obviously one cannot expect much from Android Studio. The original answer is here by the way: stackoverflow.com/questions/4815301/…
-
Denny over 6 yearsWell, you got an answer for that @LynAs?
-
Roshana Pitigala about 5 yearsThis is awesome. Thanks!
-
Pierre almost 5 yearsWhy isn't this enabled by default? Will make a lot of people's lives easier