'How to set class name in File and Code Template in Android Studio
I want to define template once create new file or class in Kotlin in Android Studio look like:
/**
*
* FootballApp.kt
*
* Created by on 11/04/21 Android Studio
*
*/
i've use the code as below:
/**
*
* ${FILE_NAME}
*
* Created by on 11/04/21 Android Studio
*
*/
but once i use ${FILE_NAME} it always create file name but it miss .kt, So anyone help me this problem
Solution 1:[1]
${FILE_NAME} only returns the name of the file without extension.
As templates apply extension-wise, you can append .kt to it, for it to be included in the file.
/**
*
* ${FILE_NAME}.kt
*
* Created by on 11/04/21 Android Studio
*
*/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Praveen |
