Problem:
layout XML folder is missing?
How to add it?
If the folder isn't there or wasn't added automatically when you created the project, you need to add it to your project in the following way:
Right-click on the res folder
Select New -> Android Resource Directory from the menu that opens
Select Resource type to be layout from the popup that opens
Click ok
Now you have added your layout folder, so you can now start adding XML files to this folder by the following steps:
Right-click on the layout folder
Select New -> Layout Resource File from the menu that opens
Enter your new file name
Click ok
Now you have a new XML file that you can use in any activity or fragment.
After open the layout resource file and which new file name, can be typed
Related
how do you create a res/menu folder with a main.xml when a res/layout has a main.xml file
In the project tab of left pane, select the res folder and Control+click to open context menu. Then, New > Android Resouce Directory.
Just name it menu for the directory name. And click ok.
Now you got res/menu, select it and Control+click to open context menu. Then, New > Menu Resource File.
Input your menu resource file's name (ex. main).
At last you can get res/menu/main.xml.
According to the Android Studio first app tutorial, there should be a folder in the res called layout folder and inside that folder > activity_my.xml file.
My res folder does not contain the layout folder, it has drawable, mipmap, and value folders.
I have attempted restarting the program and creating multiple new projects.
Right click on resource folder and create new directory with layout name and put your xml in it . i hope your problem solved .
Right click on res folder and create new directory with layout name and put ur XML in it . hope ur problem solved .
Don't create in drawable folder , create in res folder or another way is to cut your layout directory and paste in res folder
I am using Android studio 1.2.2 and need to know how to create a new shape file in drawable folder. I have already done the same in Eclipse but unable to do so in the android studio 1.2.2
follow these steps
create a drawable folder in res directory.(if not present)
right click on drawable folder> New > Drawable resource file
Give your file a name and change the root element to shape.
(its selector by default)
now you are good to go.
I was confused by the post from Anirudh when he said to change the root element to shape. But here is full demo.
Basically, the shape element is not provided by drawable resource file list by default. So just create one and then change the root xml element to shape, manually.
Right Click On drawable folder
Select New -> XML -> Layout File
Type Root Element shape
I have this custom xml file. I would parse it later.
The problem is where to put it. I used eclipse adt.
I created a new folder in the resources. I named it "xml".
After that i tried to create a XML file in the folder.
Right clicked the xml folder>new>android xml file
Then the window pops. I change the folder to res/xml but when I clicked the finish button nothing happens. Can you help me with this? Thanks.
Clean all your projects.
Update your ADT.
If its not the layout file, place it in asset folder
<AppName>/assets/
If you create android xml then that should be created in layout folder and extends any of android layout or controls.
For creating custom xml file, right click on res/xml folder --> new --> file and enter your filename.xml
Don't forget to add extention .xml
this might sound silly. i am trying to do tab layout for android.
there is a part where i need to create a drawable folder and have android xml file in that particular folder.
i have looked into all the tutorial and youtube for this. The tutorial shows create a new android xml file and choose Drawable for the type of the resources.
in my case, i cannot create new android xml file with Drawable as the type of resources as Drawable does not exist. Below shows the interface.
is there anyway can help me with this? i also tried to add the resource manually but it wont work.
if i am creating a new android xml file with other resource type and force it to put in drawable folder, the application crash.
1. Go to your project explorer which should be on the left side of your eclipse IDE.
2. Right click the res folder of your project
3. Click new, then folder
4. Name that folder drawable
5. Right click your new drawable folder, click new
6. Search for XML File in the XML folder
7. ENJOY :)
I'm not sure if i understand exactly what you mean, Is this what you want to do? If so then the steps provided is how to do so, if you need me to clarify let me know.
Do the following,
your project -> new -> Folder -> write drawable in the text box -> finish
So, drawable folder is now created in res folder.
Then,
drawable -> new -> File -> enter the name of the xml file you want to create (ex. test.xml)
OR
drawable -> new -> Android XML File -> enter the name of the xml file you want to create (ex. test)
Now you can see there is a .xml file in your drawable folder. Now you do whatever you like to do with this .xml file.
#Sara if you have successfully created your extra "drawable" folder, right click on the new "drawable" folder and go to new Android XML File, just name the new xml file and finish next.