I have my own XML files in a ./values folder. However I have no idea how to use/ call them. Any suggestions?
Asked
Active
Viewed 451 times
2 Answers
1
- Create a folder called "xml" inside your res folder.
- Place your xml file there, say yourfile.xml
Use it in xml as:
< include layout="@xml/yourfile" android:id="@+id/yourXmlId" />
You can also use it in Java as:
XmlPullParser yourXml = getResources().getXml(R.xml.yourfile);
You could also place the xml file in other folders like "layout", "drawable", "anim", "dimen" etc., depending on your use case or requirement.

kds23
- 296
- 3
- 17
0
Can you mention what is the purpose of that xml?Is it created for creating background?I f you created it for drawing some shapes or your on images,please put it in drawable(res/drawable) folder.If your xml is for color,config,dimension,string,or style, put inside res/values folder.You can also create xml for menu related stuffs.Such xml can be put inside menu folder.

Suhail k k
- 66
- 7