Step 1 : Right click on res folder, choose New > Android Resource Directory
Step 2 : Choose layout
in resource type, then click OK
Result : Error in name : enter or select a qualifier
It's not happen with menu type. Do I missing something? I have to create directory instead
Select layouts , right-click and select New → Folder → Res Folder. This resource folder will represent a “feature category” that you want. You can easily create any type of file/folder in Android Studio. If you have N vertical features, you need to create N folders.
In the drop down menu click on the new option. After this a drop down menu opens here you will see directory option just click on that. After this enter the name of your directory / folder and press enter this will create a new folder / directory inside your root folder.
Qualifier name rules You can specify multiple qualifiers for a single set of resources, separated by dashes. For example, drawable-en-rUS-land applies to US-English devices in landscape orientation. The qualifiers must be in the order listed in table 2. For example: Wrong: drawable-hdpi-port/
It's an old question but whoever is having the same problem might find this helpful. Here's another way to create an android resource directory in the layout folder.
Also, make sure to refactor and rename(whatever you like) the XML file that gets generated automatically after creating the resource folder.
Yeah, AS 3.0+ seems to do that to me as well.
But there really shouldn't be a difference between a new Android Resource Directory and just a new (regular) Directory if you don't actually use any qualifiers. It's still just a directory with a different name depending on the qualifier(s). So, you can safely choose new Directory and move along.
And for the sake of it, you can choose new Android Resource Directory with some random qualifier which will just add the qualifier to the directory name, and after it's created, refactor it by deleting the qualifier part from the directory name and you'll end up with a directory named "layout" which is an "Android Resource Directory".
Just do the refactoring with the Project view selected in the Project pane, not the Android view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With