Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Android xml layout file doesn't recognize content assist by ctrl+space?

I am facing problem with eclipse that is when I am using the Android xml layout file to design a screen, I try to add attribute to an element that I have already created. I used to type two letters of the attribute then tap ctrl+space so it will show list of all available attribute by IntelliSense. Now it is not showing anything, instead it is showing a message at the bottom of the screen like below image.

Anybody faced the problem and solved it?

Appreciate your help because it is slowing down my work.

enter image description here

like image 386
Amt87 Avatar asked Oct 31 '12 07:10

Amt87


People also ask

What content is to about an XML layout file?

Each XML file contains a tree of elements specifying a layout of widgets and containers that make up one View. The attributes of the XML elements are properties, describing how a widget should look or how a container should behave.

Where is values XML file in Android Studio?

Deciphering the Styles file Fire up Android Studio and search for values. xml and select the one contained inside the appcompat-support library.

What is the location of the color XML file in the Android project?

xml" file located at res\values\colors.


2 Answers

Answer Updated:

Here it goes,

I guess you are trying to access Parameter Hints (Ctrl+Shift+Space) Instead of Default Content Assist (Ctrl+Space).

  1. If we press (Ctrl+Shift+Space) in the java file it will gives you the detailed parameter description with the particular list of method names.

  2. If we press (Ctrl+Shift+Space) in the xml file , it will gives the following errors,

    (a.) Element or or anything is unknown.

    (b.) Content assist not available at the current location.

    (c.) No completions available.

Old Answer:

According to the Eclipse content assist documents ,

the Element Unknown errors are because of,

The Element, we are looking for is not defined in-scope schema definitions.

XML Content Assist will be loaded from the schema files and the belonging xml file descriptions.

So mostly no chances to be missed Elements in android sdk.

Check whether any thing missed out in the following preferences,

Window-preferences-XML-XML Files-Editor- Content Assist Check the priorities or reset it.

I guess, You may missed somewhere, because i noticed that in your attached image,

Graphical Layout.xml is your layout name. It cannot be named like that, In android , it should be without any space and should "Starts with lower case".

If you give the detailed *error report*, then it is possible for somebody to tackle it.

You mentioned that , for all of the layout files you are getting the same error, so you can create a simple sample layout and paste with your question.

So my suggestion is, please check whether do you went wrong in somewhere in the xml file by defining and providing open with priorities or not.

And do check the XML Content Assist in the Window-Preferences menu.

like image 109
Kartihkraj Duraisamy Avatar answered Oct 01 '22 12:10

Kartihkraj Duraisamy


( No pun or ecipse bashing intendet ) There is a lot of grounds for eclipse chocking on some files, and almost never solution - you just hope that it works. For android I would recommend you to switch to IDEA - android plugins are contrained in free community edition and work like a charm ( and shall be there a problem, jetbrains support usually provides useful and correct answers in couple of hours )

There is even previews mode for UIs which updates as you type allows you to extract themes and whatever.

like image 22
Konstantin Pribluda Avatar answered Oct 01 '22 14:10

Konstantin Pribluda