Yes, you can do that. You can have one layout XML file and use the same layout in different activities. All you have to do is to use the same layout id in setContentView()
method.
The same applies to fragments.
solved can single xml file be linked to multiple java classes? [duplicate]