layout resource directory not created automatically when I create android project in android studio

Issue

At first when i create my my android project in android studio android studio automatically creates a layout resource directory which contains the activity_main.xml file along with the main.kt file in the java directory.But after creating some few projects, android studio fails to provide me with the layout directory with the activity_main.xml and main.kt files automatically.I’m a beginner with the android studio environment that’s why i prefer it comes with the layout resource folder and activity_main folder because I mess up the configurations when i create them by myself and fails to lunch app on my android phone.I would like to know whether there is a way to reverse this problem or i should always create my layout resource directory by my self if so then i would like a demonstration of how to create my main_activity.xml so that i don’t mess the configuration.Any help would be appreciated and thanks in advance.

Solution

It seems you are looking to create from a template (create activity along with the layout and added the activity in the manifest as well). Please read the docs in here: https://developer.android.com/studio/projects/templates

Answered By – Putra Nugraha

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published