Search code examples
android-studio-4.0

Android Studio 4.0 New Class


Android Studio 4.0 has been released, and I try to create a new Class, but there is some difference here, the class isn't been created directly, I have to fill information on these input box, but I don't know what to fill in these. If anyone knows how to fill it out, please answer this question.

https://i.sstatic.net/RUvVU.png


Solution

  • You can check the code of the file template in android studio 4.0: enter image description here

    You can also read the doc: https://developer.android.com/studio/write/create-java-class#variables

    • IMPORT_BLOCK - A newline-delimited list of Java import statements necessary to support any superclass or interfaces, or an empty string (""). For example, If you only implement the Runnable interface and extend nothing, this variable will be "import java.lang.Runnable;\n". If you implement the Runnable interface and extend the Activity class, it will be "import android.app.Activity;\nimportjava.lang.Runnable;\n".
    • VISIBILITY - Whether the class will have public access or not. It can have a value of PUBLIC or PACKAGE_PRIVATE.
    • SUPERCLASS - A single class name, or empty. If present, there will be an extends ${SUPERCLASS} clause after the new class name.
    • INTERFACES - A comma-separated list of interfaces, or empty. If present, there will be an implements ${INTERFACES} clause after the superclass, or after the class name if there’s no superclass. For interfaces and annotation types, the interfaces have the extends keyword.
    • ABSTRACT - Whether the class should be abstract or not. It can have a value of TRUE or FALSE.
    • FINAL - Whether the class should be final or not. It can have a value of TRUE or FALSE.