Android XML editors broken in Eclipse - android

Until today (I have no idea what I did to cause this), if I double-clicked an android XML file, then the correct editor would appear.
For example, double-clicking a layout file would open a Graphical Layout tab and a tab with the XML contents for direct editing (named as the file being edited). Now all I get is a Design and a Source tab!
I am unable to preview the layouts I am editing (this is the same as here: Graphical Layout tab does not appear for some layout files into Eclipse)
That link also gives a 'workaround' in that I can right-click the file and open with the right editor, but this isn't a solution!
How can I sort this permenantly? I have re-installed fresh Eclipse, ADT to no avail (haven't used fresh SDK... will that matter??).
** Note this happens to all Android XML files, not just layout ones I mentioned above! **

Yes this may be a permanent solution:
Select any XML layout file
click on Window->Preferences menu.
Follow steps as mentioned in attached image.

What I had to end up doing was selecting the Legacy Android Xml Resources Editor from the same list that Paresh is showing and setting it as the default. I had to choose it from the list that appears when you click the add button. After that I restarted eclipse and everything was fine.

Related

Android SDK Cant See Graphical Layout

When I open MainActivity.xml file in my layout folder of android project and click on graphical layout I can see only a gray blank screen. The android UI is not visible in my eclipse. When I searched google and stackoverflow I found I should open the .xml file with android layout editor but this option is not available in my eclipse. And when I tried to add this option from preference I don't find this option.
Go to Preferences -> General- >Editors->File Associations.
If Android layout editor is missing click on Add as shown,
After clicking on Add select Android Layout Editor and then click on OK.
Close Eclipse and restart. Otherwise this will not work.
SECOUND CHANSE I DID TI
1.WORKSPACE FOLDER ALL CONTENT OR FILE DELETE
2. OPEN THE ECLIPS

Eclipse is missing Graphical Layout and Source tabs when editing Android XML files

When I edit XML files in Eclipse using Android Common XML Editor I am only able to use the graphical layout editor. I see in pictures online how there are supposed to be tabs at the bottom for Graphical and Source but I have none. How do I get this fixed? Using Eclipse 4.2.1. Thanks!
That is probably a problem of Unity not displaying the editor correctly. I bet that you can still switch between the tabs using the keyboard. Press ShiftAltF7 to navigate to the previous page and AltF7 to navigate to the next page of a multi page editor.
I faced same problem so far.
Solution:
==> In your Layout editor there is a android version configuration dropdown box, from there select proper android version. (Eg. "Android 2.3.3")
try this and let me know.
I have discovered that this problem occurs after installing custom theme for eclipse. In my case it was "Dark Juno" theme. Bring back original theme and everythink will be all right again :-)
------ EDIT ------
You can use MoonRise dark theme ( https://github.com/guari/eclipse-ui-theme ). Bottom bar works perfectlly and design looks good.
Please try to use OpenWith ->Layout Editor on the xml file witch u want to open from project explorer under res folder

Android Eclipse does not show my Layout files in the Layout Editor be default

I have updated my Eclipse and some of my projects have stopped showing in the Layout Design(and instead shows a basic XML design),
What I have found, in order to open the Layout file I need to right click and go to Open with and then selecting the Show in Layout Editor
I have a big Project I just can't keep on doing this, has anyone come across such problem? and a possible solution for the same
This problem has already been addressed.Apparently, this problem happens in certain versions of ADT.Please check the marked answers from
No Graphical layout editor in Android and
I cannot find the graphical layout tab for xml on eclipse
I had tghis to but
after several times performing this action the layout editor was set to default

How to get the graphical layout Window back in Eclipse for Android Application Design?

I dont know what happend, but i lost the Graphical Layout Window of the XML Layout that we are using in Eclipce to design the Android Application.
I want that Design window back.
I can see the xml code and every thing. . . But i want the Design Editor that is available as by default in the Eclipse after integration of the Android in it.
So how to get it back ???
No one has answered my question, but by searching on Eclipse I got the answer:
I have to right click on the XML code layout and then select Open With Layout Editor. It will show me the Graphical Layout Editor for my Application and now I am able to see the graphical view on the XML layout files.
Do you not see the "Graphical Layout" tab on the bottom of the open xml file?
Just follow this pattern : Package Explorer ---> res --> Layout ---> activity_main.XML Open activity_main.XML
if you are using the dark juno color theme the tabs at the bottom don't show up.
change back to one of the original color themes and poof they're back.
In Eclipse,just click check for updates and after that it will restart the eclipse and now u can see the graphical layout,the problem was in ADT plugin only.
If you want to open all the xml files in layout editor, go to Preferences->general->editor->FIle associations
Change the default editor in the selections
For me, after reading endless non-viable solutions (including remove and re-import the project, click the 'open with...' menu and the like) the solution was stupidly simple. I was opening the project with the standard Eclipse studio. The solution was to open Eclipse via the ADT bundle directory, that is the version of the Eclipse studio packaged and installed with the Android ADT. Using THAT shortcut to Eclipse, an Android project opens and runs (and edits) as a native Android project using appropriate Android tools.
The answer is to right-click and select open DEFAULT Editor...Then on bottom of editor two tabs will change on the lower right. Click on Graphical Editor.
Resolved installation ADT http://developer.android.com/sdk/installing/installing-adt.html
This contain all preview layout and XML editor
You can also, in the project explorer on the left, go to res, layout and double click on activity_main.xml

Unable to open both main.xml files from layout & layout-land at the same time?

While developing for Android, I am unable to open more than one main.xml file in an Eclipse editor at a time. Each time I open one, it simply replaces the editor (tab) of the first main.xml with the new one, instead of opening a new tab - even if the contents of the existing tab were unsaved!
Even stranger, I can open multiple main.xml files from different projects with no problems. This only happens when they're within the same project.
Any idea how to fix or work around this? It's a real time-waster.
(Running Eclipse Classic 3.5.2 64bit w/ADT 0.9.7 on Win7 Home Premium x64)
Edit for clarity:
It's not the same file opened twice. In one project, there is a file called "main.xml" in a directory called "Layout". There is another file also called "main.xml" in a directory called "Layout-Land". These two files cannot be opened at the same time. I'm not sure if this is a problem with Eclipse or with ADT.
More info:
For kicks I created two new files in those same directories (both called "item.txt") and they both opened properly (each in their own tab). I renamed them both to "item.xml" and tried opening them again, and sure enough they fought for the same tab. This leads me to believe ADT is at fault since xml files in these layout directories are opened with ADT's layout tool. I could be wrong though.
Right click on main.mxl and choose 'new editor'- this will create another main.xml which you can replace with the landscape version via a double click.
However, eclipse does this for a reason- so you don't get confused and bork your files up.
I would think you also could edit these files in a text editor to the side with little loss of efficiency.
This is because the two different files represent the same layout just in different configurations. If you want to edit the landscape layout you have to click on the 'Layout' tab at the bottom of the editor and select the 'Config' that you want to edit. Depending on the configuration you select you'll have the layout xml editor fill with the correct contents from each file.

Categories

Resources