MUMBUÇOĞLU
MUMBUÇOĞLU

Reputation: 251

Code Completion of Android Studio

When I use code completion of Android Studio,it always shows only default constructor of object, not constructor with attributes.How to show all constructor of object using code completion(ctrl+space)

Upvotes: 0

Views: 2084

Answers (3)

MUMBUÇOĞLU
MUMBUÇOĞLU

Reputation: 251

I found how to do it.In Android Studio,File>Setting>Editor> check "Insert selected variant by typing dot,space..."

Upvotes: 0

Eugen Pechanec
Eugen Pechanec

Reputation: 38223

Press Alt+Insert, a code completion popup menu will appear. The first item should be Consturctors so press Enter. Now a dialog will appear which will let you select

  • constructors from superclass to override
  • create a new constructor based on field variables which you choose

Upvotes: 2

stkent
stkent

Reputation: 20128

If I autocomplete while typing a class name, Android Studio normally completes the name with no parameters listed. I then use the (Mac) shortcut command-P to list all available parameter combinations. It won't fill parameter values for you (obviously), but it lets you see what is available. I'm sure there's a corresponding Windows shortcut to do the same thing.

Upvotes: 0

Related Questions