I've recently started designing apps in Android Studio, and I've noticed that the same operations (for example, using a widget) can be completed by either going into the activityname_java file and creating the widget as a java object, or by going into the activity_activityname.xml and using the combination of drag-and-drop plus HTLM to make the widget.
My question is, how do these different methods work together(Java and HTML)? I don't see one file change when I edit the other one, so must I primarily rely on just one of them? Is there any way I can keep the other file updated as I edit one? Is there any advantage to using one type over the other? Any information would be greatly appreciated.