1

There are similar questions, but none address my specific issue.

I'm rather new to Android development and Eclipse but was able to follow the tutorials A OK.

In fact, I'm able to edit activity_main.xml from a tutorial, but now, in a test project I'm working on, I can't edit my new activity_main.xml (again, different project, same filename).

I created the file by right-clicking on the layout folder then selecting NEW > OTHER > Android XML Layout File. I was able to copy some of the other file so that my file now looks essentially like this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    </LinearLayout>

When I type, the cursor moves around (looping through the text) but no characters appear on the screen. Again, in the other XML file I can edit with no problem.

I'm hoping that this is just some newbie problem.

Community
  • 1
  • 1
ari gold
  • 2,074
  • 3
  • 25
  • 51
  • That's a very odd problem that I've never encountered. I would first try cleaning the project and restart Eclipse (which I assume you have tried) – codeMagic Jun 24 '13 at 01:07
  • @codeMagic, actually I didn't thnink to clean the project or restart but after installing Papyrus Eclipse restarted on its own, fixing the problem. It's a strange one. If I have time I'll try to replicate for the devs, otherwise I'll just pay attention. – ari gold Jun 24 '13 at 02:51
  • @codeMagic, feel free to rephrase as a question so that I can accept your answer. – ari gold Jun 24 '13 at 02:51
  • Are you using the newest ADT *and* the newest Eclipse? Odd problems have cropped up with text editing in older ADTs. – nitind Jun 24 '13 at 03:37
  • @arigold I have posted as an answer. If there's any details that I left out which might be helpful, feel free to add them – codeMagic Jun 24 '13 at 04:15

2 Answers2

0

I have had similar problems, though not this exact problem. Sometimes simply restarting Eclipse, or whatever editor you use, can help. Occasionally, Eclipse will not detect changes in your xml so you need to clean and rebuild the project. You can do this by

Winodow --> Project --> Clean...

and choose your project

I know there was an issue that I had which was similar with the editor jumping/replacing lines and such which I believe was fixed in a newer version of Eclipse. If I can find a source later I will edit

codeMagic
  • 44,549
  • 13
  • 77
  • 93
0
  1. Clear all of text in layout activity_main.xml (in code view)
  2. Drag and drop new LinearLayout in layout (in graphical view)
  3. Go to Project -> Clean
The Badak
  • 2,010
  • 2
  • 16
  • 28