Why the letter case inconsistency between src and res/layout?

0 votes
asked Mar 17, 2010 by peter-vdl

I called my main activity Main, and Eclipse created Main.java and res/layout/main.xml for the layout.

Is there any reason why Eclipse dropped the uppercase "M" for the layout file?

Was I wrong to use upper case M for the name of my Main class (a Java convention, types start with uppercase, objects with lower case)?

2 Answers

+2 votes
answered Mar 17, 2010 by erich-douglass

Layout file names can only contain lower case letters, numbers, underscores, or periods. I'm not sure why the restriction exists, though.

+2 votes
answered Mar 17, 2010 by caseyb

Whereas Erich is correct about the restriction to only lowercase letters in resources, it is only coincidence that you named your Activity Main. No matter what you call your primary Activity the generated layout file is always called main.xml.

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter