Error in creating a new class file for Android studio

Error in creating a new class file

After Baidu, the reason is: there is no class template

Solution: in file > settings> File and Code Templates> Add the following code to class:

#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
 
#if (${IMPORT_BLOCK} != "")${IMPORT_BLOCK}
#end
#parse("File Header.java")
 
#if (${VISIBILITY} == "PUBLIC")public #end #if (${ABSTRACT} == "TRUE")abstract #end #if (${FINAL} == "TRUE")final #end class ${NAME} #if (${SUPERCLASS} != "")extends ${SUPERCLASS} #end #if (${INTERFACES} != "")implements ${INTERFACES} #end {
}

 

Similar Posts: