42

In Android Studio, I want to create the folders values-v14 values-v21 inside the res folder.

But when I tried to make it like: right click on res folder select option New >Directory, then after creating the folder, it is not visible in Android Studio. But when I select the option Show in Explorer, then it is visible.

How do I create a folder in Android Studio, so that I can change files like styles.xml, etc?

nbro
  • 15,395
  • 32
  • 113
  • 196
PPD
  • 5,660
  • 12
  • 52
  • 86

6 Answers6

106

Try to switch from Android to Project as shown below

enter image description here

nbro
  • 15,395
  • 32
  • 113
  • 196
J.Vassallo
  • 2,282
  • 3
  • 15
  • 14
47

Switching from the Android view to the Project view will allow you to see the directory structure, but it is less convenient for viewing and editing Android files.

There is a better way. Don't use New > Directory.

Right click values and choose New > Values resource file.

enter image description here

Select Version from the list and click the >> button. Write styles as the file name and 14 as the version number and click ok. (Repeat all this for version 21.)

enter image description here

Android Studio will automatically create values-v14 and values-v21 directories with the new styles.xml files in them. And in your Android project view you conveniently see all three styles.xml files together.

enter image description here

Other directories and resource files can be similarly added.

Community
  • 1
  • 1
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
5

You can also manage language stuff with the editor, it´s a little faster.

String Editor Window

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Manuel Pirez
  • 565
  • 6
  • 9
0

Instead to looking for the file from ANDROID, go to PROJECT and then look for the folder, you will find it there...

Jeffy
  • 276
  • 3
  • 9
0

I believe this is like version control, where the folder exists, but you need a file inside in order to view it. I just ran into this, and the folders existed but didn't show up until I had a file inside of them.

I hate to think this is by design. The use-case of a developer hiding their own work-space? Collapsing makes more sense

Stephen J
  • 2,367
  • 2
  • 25
  • 31
0

it's so simple to find your new values-v21 or recently created.. (1) - Go to project files (2) - app > src > main > res (3) - if here is not visible your directory then (4) - right click on res and select show in explorer (5) - Go inside res here all your files are shows (6) - Then Go inside values > copy style file from there and come back to paste inside your values-v21 folder (7) - you are done .. go to your android studio and see your folder values-v21 is appearing.

Note :- Your folder was empty so you folder was not appear in android studio.