I cannot figure out how to search for text inside an individual XML file from Eclipse. Basically if I am editing one of my xml layout files, and I hit CTL + H -> file search -> Selected resources radio button checked, I always get '0 results in empty scope' as my results. Google hasn`t given me any help on this.
My workaround is to choose 'Workspace' instead of 'Selected resources' and then navigate to the file I want in my search results which is time-consuming. Why doesn't eclipse recognize my current XML file as a selected resource like it does with java files? Has anyone else had this issue? I`m using Eclipse ADT 23.0.2.129578
Go to the Source tab of the layout file editor, then use Ctrl+F to open the Find/Replace dialog. You can also use Ctrl+K to traverse through matches of the last search, even when the Find/Replace dialog is closed.
You can use Ctrl + Shift + R for searching the XML file quickly in eclipse.
Related
I am working on a multi-module application that has hundreds of XML layout files. Many of these files have duplicate or similar id's. I am trying to navigate to a specific screen layout file by using the Layout Inspector in Android Studio, but when I click on the "id" attribute, I do not see a link to the corresponding XML file. Instead, I see "unknown:?" displayed. Additionally, when I try to find the specific XML file using the "Find in Path" feature in Android Studio, I am unable to locate it. How can I navigate to a specific screen layout file in this scenario?
Clicking on the
Search Everywhere
Icon at the top-right, if I write
*.xml
in the search row and click on the
Files
tab, then I'm able to see all the xml files.
I'm trying to modify strings inside an apk, I could find almost all strings at the strings.xml file, but there are still strings I can't find as shown in the image
enter image description here
I tried to use the Ctrl + Shift + F to search in the entire proyect but no results, I even tried to search for harcoded strings but same result, are they stored at somewhere else? are they added with java code inside files? does anyone has any clue?
Clean the project and restart once check it.
I am only getting autocomplete in my xml layout when i type "android:" I want to get it whenever I press cmd+space. I am using a mac
Go to
Eclipse -> Preferences -> XML -> XML Files - > Editor -> Content Assist
and tick all proposals checkboxes to allow this.
EDIT : Also tick Automatically make suggestions and Insert single proposals automatically checkboxes.
Open Preferences and in the search type XML, you would find on the left pane a XML hierarchy and under editor you will have content assist. Just tick all the boxes there are in this page and you are good to go!
Window--->Preferences----->General------->Keys, find Content Assist and set attribute Binding as cmd + space, and attribute When as Editing in Structured Text Editors, if it still not work, right click on your xml file, choose open with, try to use Android Menu Editor. Good luck.
I found the solution:
I needed to unselect in my mac SystemPref --> keyboard-->shortcuts there was a command "select the previous input source"
All You want is code promption whatever you enter.
Eclipse -> Preferences -> XML -> XML Files - > Editor -> Content Assist
Then input "prompt when these characters are inserted" with
#+<=:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
Is there any way to make Eclipse + Android SDK + ADT Plugin offer some sort of auto-complete in XML files if I hit CTRL+Space when my cursor is in a spot such as the ones marked with an * below.
<LinearLayout id* ... lay*>
The thing is that I think that the above was actually working already directly after the initial install - even though it of course never worked within style files.
<style name="ActionBarWrapper" parent="Fill_Parent.Vertical">
<item name="android:layout_height">36dp</item>
<item name="a*"
</style>
There is an icon in the eclispe toolbar to directly access the "new android xml file" wizard.
You could use IntelliJ IDEA instead of Eclipse, it has full auto-completion and works well for Android development.
http://www.jetbrains.com/idea/
The Community Edition fully supports Android, and is FREE
The latest ADT plugin (r9) does have partial auto complete feature in the layout xml.
for example, if you type ctrl-spacebar while the cursor is between 2 tags, you get the list of all avaliable tags (views and layouts). If your cursor is inside a tag, you get a list of all avaliable attributes.
First of all: Thanks for the good advice everybody. Not sure if the following should be an answer or a comment. Going for the answer because comments do not allow enough characters.
After trying out some eclipse plugins (like Rinzo XML Editor ) I found out that it actually worked for some files while it did not work at all for others. After some testing I am now under the impression that there is a difference between creating XML files via...
New > XML
and
New > Other > Android > Android XML File
I double checked that even when both files have exactly the same content (xml-version, encoding, namespace etc.) they behave differently with regards to auto-code-completion depending on the way of file-creation. I also checked the file properties but could not make out any significant differences. Obviously it must be something local or some meta stuff I am overlooking.
I think the different behavior is because when you create the file using "New->XML" the wizard opens the file using the default associated editor to xml content.
If you create a file using "New->Other->Android->Android XML File" I think the wizards tries to open the xml file using a specific xml editor, instead of the one you have configured as default, in this case Rinzo I guess.
In the second case why don't you try finding the xml file in either "Package Explorer" view or "Navigator" view, right click on the xml file and selecting Rinzo through the "Open With" option.
Hopefully, this is a newbie question with a quick answer...
I am attempting to add a simple preferences file in a new Android project (New -> Android XML File), but it doesn't appear to be working correctly.
There is no root element to choose from when I select the Preference type layout. If I press Finish, it doesn't do anything. See screenshot below.
Thanks,
wTs
Just create a normal xml file to the project /res/xml/ folder and add your content to the file as usual. Should work just great. Eclipse detects it as a preference file once you have added the preference-xml and saved it.
You don't need to have a root element in the selection screen. Just replace whatever eclipse generates with what you want.
try refreshing the folder that the file is supposed to be in (in your example res/xml).