A keyboard shortcut to comment/uncomment the select text in Android Studio

Solution 1:

To comment/uncomment one line, use: Ctrl + /.

To comment/uncomment a block, use: Ctrl + Shift + /.

Solution 2:

MAC QWERTY (US- keyboard layout) without numpad:

Line comment : + /
Block comment: + + /


MAC QWERTZ (e.g. German keyboard layout):

Android Studio Version ≥ 3.2:
Line comment : + Numpad /
Block comment: + + Numpad /

thx @Manuel


Android Studio Version ≤ 3.0:
Line comment : + -
Block comment: + Shift + -

Solution 3:

From menu, Code -> Comment with Line Commment. So simple. enter image description here

Or, alternatively, add a shortcut as the following: enter image description here

enter image description here