When I try to create a new menu resource file in res/menu as stated in the guide, the folder is not there. Neither is res/xml. Can someone tell me how to solve this problem? I tried to create the folder but it didn't allow me to do so
If it is in android studio v2.1.1, to create a res/menu folder follow these steps:
Right click on res -> New -> Android resource directory -> Change the Resource type to 'menu' in the drop-down menu -> click OK
To create menu file under menu folder follow these steps:
Right click on menu folder -> New -> Menu resource file -> Give the file name -> click OK.
Note: For xml file it's the same procedure but in the dropdown menu choose 'xml' instead of 'menu'
In Eclipse? Right-click on the res folder, select New and then select Folder.
You should be able to create the folder with no issues. Check that you have write permissions on that folder. Also you can try to right click on the res folder and go to new then other. In the window that pops up select Android -> Android XML File. In the new window you can use the radio group to select what type of file you want to create. This should create the folders for you.
Right click on the res folder-->New-->Android reesource directory
There you can set Resource type: as "Menu" and add Menu XML as required.
change the "Android" tag to "Project"
After doing that, find the Directory you created (manu)-> right click on the folder and choose "Menu Resource File"
On the new Dialog change "Values" to "Menu -> press OK
Now you should see the "menu" folder in Android tag!
Related
I can't find a way to add an icon.
I read that you can right click and create a new Image Asset. But it can't be found on the latest version of Android Studio.
https://stackoverflow.com/a/34331879/179736
You have to navigate to .app/src/main first - not directly to .app.
Then right-click on res folder and you will be able to add your image asset
check here
click on main menus ---> file ---> new ----> ImageAsset , like this :
or right click on res folder and new Image Asset :
I want to add a menu options (like it was in default old api's)
I created a project that the minimun is 16 and max is 22
I dont find the menu.xml file in res directory.
Didn't find how to create and use it
right click on res folder select new--> create new resource directory
and select resource type as menu, will create menu folder. then create menu.xml
Right Click on res folder then click on Android Resource Directory then you will find another dialog contains values.. scroll this to find menu
In Android Studio, besides the default layout folder, I need to create layout-land for different layout in landscape mode. However I couldn't add a new folder. I've tried some ways such as right click -> new -> Directory, right click -> new -> Android resource directory, right click -> new -> Folder but all of them didn't work at all. What is the appropriate way to create a new layout folder?
On the left on Android studio there where you can see all your classes and packages you can see on top a selector. try altering that selector to show Project rather than your app if this is the situation.
Sometimes when you show only app contents resource folders are somehow hidden when they are empty but when you switch to project view most of the times are visible.
Right click on layout folder -> New -> Layout resource file
Choose Orientation in bottom frame and select Landscape
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?
Try to switch from Android to Project as shown below
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.
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.)
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.
Other directories and resource files can be similarly added.
Layout files
Language translations
You can also manage language stuff with the editor, it´s a little faster.
Instead to looking for the file from ANDROID, go to PROJECT and then look for the folder, you will find it there...
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
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.
I am new to intelij IDEA. I have just discovered that there is no drawables folder in my res folder.
Do the drawables come automatically or you just have to add it by yourself?If so how it is been done?
I will appreciate your response.
Just drag and drop the image from the source folder to idea res/drawable package. I know for a fact it works for PNG image.
In Android Studio you can press mouse right button on res folder and then go in new section and choose "Image Asset". In it find "Asset Type" press on it and select "Action Bar and Tab Icons" then select your image path, write name for it and that's all. Although if you won't see it just select "Project" isteaad of Android in left Project menu
Right click on res folder: New -> Android resource directory.
Select resource type: drawable, change parameters as you wish, press OK.
Ready!