I am creating my own custom view. Here is the code for MyCustomView.java And my main_layout.xml file: My question is: If I change the attributes of the custom view in the .xml file, will the 2nd or 3rd constructor of MyCustomView.java file be called? Answer As described by @Zain answer the two-argument constructor is called when the layout is inflated