Skip to content
Coding Fanatic
  • Android Development
  • News and Reviews
  • Road2Pro
  • Tutorials
  • Services
  • About

Capital Idea…Or Not 53/100 Days of Code

  • November 21, 2019December 4, 2021
  • by Richard Clarke

So Android Studio has an issue with capital letters…now I know

I haven’t written xml code in a while, but today I created a styling the layout for the Travel app by hand. And NO I didn’t use autocomplete. All the bragging rights, none of the rework.

Anyway, I created my file by right clicking the layouts folder and adding a file called layout_Dialog_Box.xml. I added the XML attributes, but I kept seeing a red squiggly under the opening tag of the file

I managed to fix it, but it was the strangest issue I’ve ever seen. You can find a video at the bottom of the page and a link to the source code here.

I followed my usual steps, but for some reason, I was seeing this error. What’s more, I couldn’t use this layout to inflate a view in the class file for the Dialog.

The layout didn’t even appear under the list of layouts! This was peculiar indeed. So I tried something different. I added a new XML layout file by selecting XML in the New File menu.

I tried to type the filename layout_DialogBox when I got this warning:

Android Studio doesn’t seem fond of capital letters in layout filenames. And that’s fine! At least I know for next time. Now I see why Android Studio saves new layouts with lowercase letters in the filename by default. For more on this, watch the YouTube video below. For the source code click here

Join the mailing list to see updates like this every week!
Coding Fanatic

Image by Mahesh Patel from Pixabay

Related

That’s No List, THIS Is a List! 52/100 Days ofCode
Houston, We Have Input! 54/100 Days of Code
Richard Clarke
Richard is currently a developer using Java and Android Studio to build custom applications for Android. Richard tutored in mathematics at Montgomery College, and worked in Information Technology before entering the Software Development industry as a Quality Engineer.
100daysofcode Android AndroidDev Java

Related articles

I’d Tap That [SENSOR] –…
Where’s the Wifi? – News…
Android 12 RUINED One Handed…
Your New Favorite Stopwatch App!…
Two for Two BABY! 7…
…But the App is for…

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Join the mailing list!

This field is required.

Check your inbox or spam folder to confirm your subscription.

Follow me on social media!

  • GitHub
  • YouTube
  • X
  • Instagram
  • LinkedIn
My Tweets

Join the mailing list!

This field is required.

Check your inbox or spam folder to confirm your subscription.

Follow me on social media!

  • X
  • GitHub
  • LinkedIn
  • YouTube

Archives

Theme by Colorlib Powered by WordPress