Deniz
Deniz

Reputation: 12530

How to auto implement suggestions in Android Studio?

How can I auto implement suggestions in Android Studio just like Eclipse. Any idea?
In Eclipse we can click on the suggestions so that it will get implemented by Eclipse itself.

Eg. "If a variable accessed from within an inner class it should be declared final" in eclipse if I get this suggestion by the IDE I am able to click and implement that suggestion by IDE itself. No need to do it manually. that's what I need.

Upvotes: 1

Views: 5126

Answers (1)

Xaver Kapeller
Xaver Kapeller

Reputation: 49817

I am not sure what you mean but there are a few important shortcuts in Android Studio:

  • Generate:

    • On Mac: CTRL + ENTER
    • On Windows: ALT + INSERT

    With this shortcut you can generate a lot of things like constructors, getters and setters, correct equals() and hashCode() implementations, overriding or implementing methods... Overall its very powerful and very useful.

  • Quick Fix:

    • On Mac: ALT + ENTER
    • On Windows: ALT + ENTER

    With this shortcut you can fix most common errors and it can do a lot of work for you. You should never underestimate how powerful refactoring and quick fix are in IntelliJ/Android Studio.

  • Code Completion

    • On Mac: CTRL + SPACE
    • On Windows: CTRL + SPACE

    As the name implies this is your basic code completion. By default it shows you only the most relevant suggestions and/or classes you have used before, by hitting this shortcut twice you can show all suggestions.

  • Show Parameters

    • On Mac: + P
    • On Windows: CTRL + P

    This shows you parameters of the current method and all of its overloads, this is among the most underrated shortcuts in my opinion as it can make your life a lot easier.

Upvotes: 16

Related Questions