I am in the process of trying to add a main menu to my app.
From the google docs:
To define the menu, create an XML file inside your project's res/menu/ directory and build the menu with the following elements:
I created a "menu" file in the /res folder. However it didn't appear even though trying to create a new "menu" folder resulted in an error, meaning it exists but does not appear in "android" view.
So according to this answer I changed to packages view to see my newly created menu directory.
I tried to create a new resource file in my menu directory. Then this happens:
I am currently stuck.
change to android view then right click res folder -> select new android resource file. see then window will show, select "Resource Type" to MENU and input file name then it will automatically create the parent MENU folder and menu resource file. see
the menu that you haved created under res should start with capital letter. menu not Menu
Related
Is there some way to add a new menu to the sidebar?
Right now, I have the following menus in the sidebar:
OPEN FILES
FOLDERS
Would it be possible to add a new custom menu above those two that would then have multiple child-menus? These child-menus would be used to run various commands or scripts that would manipulate the selected text or the currently open file.
For example:
MY CUSTOM MENU
Sort selected text
Insert gibberish text
Open command prompt
OPEN FILES
FOLDERS
While it's possible to add context menu entries to the files and folders that appear in the side bar already, the side bar is not customizable such that you can add new sections or content, or even change the order of the items that already appear.
I am working on a project in Android Studio. Whenever I try to create a new resource directory under the default /res directory it doesn't appear on the project scope, but it does appear on the packages scope. How can that be? Also, whenever I try to create a layout file (XML) in the directory I create, the file that is created is not placed under the selected and desired directory.
Hope it makes sense with an example.I got these:
/app/res/layout
/app/res/layout-land
/app/res/layout-large
If I create a file in /layout-land, Android IDE places it in the /layout directory.
Any suggestions appreciated.
When you have created the the layout-land folder it is not shown in the project view, however if you right click on the res folder and choose to show in project explorer you can see the folder has been created there as you have pointed out.
When you add an XML file to this layout-land folder (copy and paste the XML file in the existing layout folder), the XML file should become visible in the res/layout folder in the project view with (land) after it to indicate it is the landscape XML file.
Finally after a lot of testing trying every button in Android Studio I Knew how to do it.
In my case I wanted to create a folder layout-port and inside that folder two xml files: activity_main.xml and detail_activity.xml but every time I tried to add a xml file that was created in layout folder.
To create in layout_port folder I had to right click in layout-port then choose New -> Layout Resources File like the image below
Please see this insctruction for different layout orientation:
You can switch between layouts in the designer as you can see on the pictures.
I am using VS2012. I tried to navigate the function definition using the context menu item "Go to definition", but the menu item is disabled.
How to enable Go to definition menu?
Delete or rename (the extension) of the SUO file in the project (root of the directory) and that should correct your issue.
I have a Dreamweaver project created with Dreamweaver CS3 and need to import it into CFBuilder 2.0. When I do this, CFBuilder creates a new Project folder and adds a "1" to the folder name. That of course breaks links to other files in the project when they are located in a different folder.
How can I IMPORT the Dreamweaver Project into CFBuilder? It doesn't need to work in Dreamweaver in the future.
Here are the steps to Import an existing Dreamweaver project into ColdFusion Builder:-
Open the Import wizard. This is accessible from the main menu by going to File > Import or by right-clicking within either the Project or Navigator panels and selecting Import from the context menu.
Expand the ”Other” directory in the list and select “Existing Folder As New Project” and click Next to proceed. Open an existing folder as a new project.
Browse to the location of the folder containing the project and select the root directory. Specify the location of the folder and the root directory. Rename the project, as you wish.
At this moment, the project has been imported into ColdFusion Builder, but it contains no properties or references of a ColdFusion project. Right-click on the project folder and select Properties to display the dialog window. From here, you can see there is no reference to ColdFusion in the left-hand menu. Close the properties window.
Right-click the project folder once again and select “Apply CF Nature.” The icon for the folder in the Project panel should change to display the initials “CF” to confirm that the nature has been applied to the project.
Right-click the project folder once more and select Properties again. You can now see the ColdFusion options in the left-hand menu. Select “ColdFusion Server Settings” and either add a new server or select an existing server to apply to this project. Click Apply to save any changes.
Hope this helps.
I want to add localized strings for my android app. Therefore I need a values-xx folder in my Res folder.
The original values folder has a blue dot, so I tried creating a new Package, but a package can't contain a hyphen so this must be wrong. Instead I tried right-clicking res and choosing New -> Android resource directory, but this time nothing happens. No dialog or reaction of any sort as I can see.
How do I create a values-xx folder?
Edit: I can create the folder from file explorer and it all works good. It is just irritating to not be able to do it from inside Android Studio.
Edit2: This bug is fixed in newer versions of Android Studio.
When you are in the Android view (rather than Project or Packages) in Android studio, you just need to right click the "values" directory and choose New > "Values resource file".
That gives you a chose of different resources you can add. For example, if you want to add a different language to your app you can choose the Language option and press the ">>" button. If you want Swahili then select that from the list, type "strings" for the file name, and press OK.
Android Studio will automatically create a values-sw directory with the new strings.xml file in it. And in your Android file view you conveniently see both strings files together.
And it is a similar process for adding other types of resources (see my other example). You no longer have to manually add the directories (but you can do that too by right clicking the res directory and choosing New > Android resource directory).
I had the same problem, what I did was create a values-xx folder inside the main directory (main>>right click>>new>>directory) and then moved that folder to res/ directory.
It's not beautiful but it is a workaround to create a folder with Android studio.
This bug is fixed in newer versions of Android Studio.
The values-xx folder we created is not showing, but when we create a file its asking
=>I have created values-21 folder and then tried with creating an xml and it asks for choosing a directory
=>I have updated to Android 1.02
Check the values-21
Lets assume i Want to create a folder named "Daylight" under res.
Step 1:
Right click on res.
Step 2:
Then go to New.
Step 3:
Then go to Folder.
Step 4:
Then go to Res Folder Option and select.
A window will be open.
Step 5:
At that window check the unchecked box "Change Folder Location"
and as assumed we have to create folder "Daylight"
Step 6:
SO name the newly created folder as daylight, in this format. src/main/res/Daylight
Step 7:
Then, Finally Click finish.
If you have already created a new directory but just don't see it in the Project Tools window. Do this
Click on Project Tools window >> Android(Drop Down) >> Click Project.
Now you'll see all your Directories in res. See the picture:
Its very simple. I too had trouble initially.
Lets break it stepwise:-
1) Open your project
2) Right click the res folder
3) Choose New
4) Chose Directory
5) Name the directory.
Thats it!! It works for a fresh project everytime!
For those finding this answer when trying to add a new res folder to a library.
Right-click java/kotlin folder > New > Folder > Res Folder