How to setcontentView with subfolder

57 Views Asked by At

i have this layout inside a folder menu< xxx.xml

How suppose i call it in java? setContentView(R.layout.xxx.xml);(i got error)

i already trying add the path to the gradle but without success

1

There are 1 best solutions below

1
On

You're calling the wrong the folder. You need to move the xxx.xml to the layout folder

As the following:

R.layout.xmlfile -> res/layout/xmlfile.xml
R.menu.xmlfile  -> res/menu/xmlfile.xml