Alex Rivera | Logout

Problems with Android XML Editor and Eclipse...Hard to manually edit XML

Asked 2011-10-10T18:00:27.470
12

It's been a few years since I have last developed android apps. Since then, a graphical editor was added to Eclipse that allows you to generate the XML for an layout in a WYSIWYG fashion (part of the android sdk). I like it. Speeds things up.

However, with this editor I am having a heck of a time editing the xml in the "xml view" as opposed to the "graphical layout" view.

When in the XML view, I can no longer use a lot of shortcut keys. Like ctl-c or ctl-v (cut and paste) and most frustratingly I can't use the "delete" key. When I perform a cut and paste, nothing happens. And checking the clipboard, I can see that nothing gets copied in the first place. When hitting the delete key, strange side effects happen. Somtimes nothing...othertimes enter widgets are removed. I can't figure it out.

While in the XML view, I can use the mouse to cut and paste and everything is fine. I can use the "backspace" key to remove text instead of the delete key. So I can get everything in there with no issues. But...this is a major pain in the backside. I have been programming certain ways for 20 years and it is hard to get myself to use the mouse to cut and paste and whatnot.

Has anyone else eperienced this?? I haven't found anything on the internet pertaining to this problem.

Note: I know I can change the editor preferences in Eclipse to just use the normal eclipse xml editor but I lose the WYSIWYG display...which is nice to have for visualization.

If you have seen this problem or know of a way to get around it...please, please, please let me know.

I don't think it makes a difference, but here are my specs.

Eclipse: Version: 4.1.0 Build id: M20110912-1510

Android Development Tools 12.0.0.v201106281929-138431

Edit
Report

2 Answers

2

You can manually define commands and shortcut keys through Windows > Preferences > General > Keys

I actually copied "Ctrl + C", "Ctrl + V", "Ctrl + Y", "Ctrl + Z" commands and define the "When"s as "Editing XML source".

It works!

answered 2012-08-03T07:43:29.200
1

The issue I face, which is demo-ed here (not posted by me) http://www.youtube.com/watch?v=nUnOesjL1IE, is fixed by disabling "Automatically format the XML edited by the visual layout editor". The formatting for layout XML is gone for sure, but at least I can edit the file properly.

answered 2012-08-24T08:16:09.840

Your Answer