Android Studio: how to remove/update the “Created by” comment added to all new classes?

后端 未结 9 1391
余生分开走
余生分开走 2020-12-07 07:53

By default Android Studio automatically adds a header comment to all new classes, e.g.

/**
 * Created by Dan on 11/20/13.
 */

Where is the

9条回答
  •  孤城傲影
    2020-12-07 08:36

    You can overwrite the ${USER} variable in the template file with the #set( $VARIABLE = "value") function.

    On windows: Press Ctrl+Alt+S and go to Settings -> File and Code Templates -> Includes -> File Header

    On Mac: Android Studio -> Preferences -> Editor -> 
    File and Code Templates -> Includes -> File Header
    

    prepend the #set() function call, for example:

    #set( $USER = "YourName" )
    /**
    * Created by ${USER} on ${DATE}.
    */
    

提交回复
热议问题