Eng. Samer T Eng. Samer T - 3 months ago 40
Java Question

android studio auto complete: how to display constructors with parameters

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.

enter image description here

While auto complete in android studio for Intent class is displayed without parameters as following.

enter image description here

How to change auto complete in android studio to display all constructors with parameters ?

Answer

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 enter image description here

in android studio no need short cut key enter image description here:)

Comments