Eclipse Android XML content assist not working

会有一股神秘感。 提交于 2019-12-10 13:54:12

问题


My content assist was working for Eclipse XML (android) until I did an update of the android sdk, now the "design" of my xml files isn't a graphical view and when I use CTRL+space, I always get these four non-usable suggestions:

"default namespace - Default namespace attribute", 
"noschemaLoc - no namespace schema location",
"schemaLoc- XML schema location attribute",  
"xsinsp - XML schema namespace"

I also installed dreamweaver which may have interfeared with the XML extension.

A suggested solution is to right click on the .xml file and select choose another program called "Android Layout Editor". But I can't find it anywhere, I think it might not be on my computer.

I have also tried changing workspace without any success.

Any suggestions how to fix this ?


回答1:


Right click on xml file and select openwith option and you can find Android Layout Editor.




回答2:


If your content assist is working for java but not for xml, go to window-> preferences->xml->content assist and:

  • set the delay to 20 ms instaed of 500
  • set the suggestion strategy to LAX
  • add the entire alphabet to prompt when these characters are inserted: <=:azertyuiopqsdfghjklmwxcvbn

These are the things that worked for me, and programming with content assist is so much easier ;)




回答3:


Update to ADT 16 which came out yesterday; the bug should be fixed there. ("The bug" being the bug that in ADT 14 and ADT 15, many newly added XML files would end up being assigned to the default XML editor instead of the customized Android XML editors.)




回答4:


Re-install the SDK android-platform that you are working with. The resource files may be corrupted [e.g. android-sdk-windows\platforms\android-10\data\res\values\attrs.xml].




回答5:


It's android sdk problem just change android currently version to another one

like if you are currently using android 2.3.2 than change it to android 2.3.3 i have tested it's currently working fine!!!

You can change it through PROJECT->PROPERTY->ANDROID now on that change version




回答6:


Or you can set the default editor in Eclipse Preferences, used Android Common XML Editor. You find it in Eclipse Preferences, General, Editors, File Associations. Click on .xml, choose "Add" "Android Common XML Editor". Select it and press the Default button.




回答7:


very helpful i am jut following Step
click on xml file-right click on file -then choose the Android Layout Editor.



来源:https://stackoverflow.com/questions/8413198/eclipse-android-xml-content-assist-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!