Comment shortcut Android Studio

Hugo Gresse picture Hugo Gresse · Aug 27, 2014 · Viewed 239.2k times · Source

I'm searching for useful Android Studio keyboard shortcut for commenting code, as in Sublime Text or Eclipse.

When I press either cmd+/ or cmd+maj+/ nothing happens...

Answer

Hugo Gresse picture Hugo Gresse · Aug 27, 2014

Mac With Numeric pad

Line Comment hold both: Cmd + /

Block Comment hold all three: Cmd + Alt + /

Mac

Line Comment hold both: Cmd + + =

Block Comment hold all three: Cmd + Alt + + =


Windows/linux :

Line Comment hold both: Ctrl + /

Block Comment hold all three: Ctrl + Shift + /

Same way to remove the comment block.


To Provide Method Documentation comment type /** and press Enter just above the method name (

It will create a block comment with parameter list and return type like this

/**
 * @param userId 
 * @return
 */
public int getSubPlayerCountForUser(String userId){}