DEV Community

orestistp17
orestistp17

Posted on

Many classes and many layout files

What is better to have a main activity class interacting with many other classes and xml files or a main activity class with many xml files?

For example in my case I have username, password,date,email in different classes and xml files and the same for the main activity.ia there a way to manage it better? ( I need the xml files to be like that, I don't know about Java classes much)

Thank everyone

Top comments (1)

Collapse
 
subbramanil profile image
Subbu Lakshmanan • Edited

Your question is a bit unclear, however, I will try to answer the best I can.

In Android, the layouts, strings, values, etc., are called resources and represented in XML format.

The easiest way to manage classes & layouts is to name them better.

Typically, the layout files start with either

activity_

fragment_

view_

As long as you follow a naming convention with relevant names to resources, it will be easy to use them in the activity/fragments.