Two methods of Android generation interface: the difference between setContentView and inflate

Recently I am learning Android development, the development environment Android Studio 4.0 official version.
android-studio4.0-201.6565218-windows.zip:

First of all, we are in touch with the creation of the interface. The first way is to create the Activity directly, and then Android Studio automatically creates the associated interface XML file for you. The general name is activity_main.xml, and the Java file is MainActivity.java;
in MainActivity. The interface is set in the onCreate method in java:

@Override
    protected void onCreate(Bundle savedInstanceState) {
   
    
    
        super.onCreate(savedInstanceState)

Guess you like

Origin blog.csdn.net/poolooloo/article/details/106802116