3

It shows a blank screen. I then have to click the blue/gray star icon and choose App theme, only then will elements show in the palette. I then have to drag an element from the palette onto the blank screen and drop it. Then the graphical layout will appear.

It used to work fine until I started playing around with themes and ActionbarSherlock.

I tried restoring defaults on all Android and XML settings but it didnt work.

Does anyone know how to fix it so that the XML graphical editor shows up when I open a layout XML file?

(The xml I am working with are not blank.)

Nikana Reklawyks
  • 3,233
  • 3
  • 33
  • 49
124697
  • 22,097
  • 68
  • 188
  • 315

8 Answers8

5

Every day i face this problem, especially when I add a new Andorid Project to workspace, the only solution I found is to restart Eclipse, I hope this will help you too.

Mohammad Ersan
  • 12,304
  • 8
  • 54
  • 77
1

I guess your issue is Eclipse related, but try to be specific next time about your IDE since it may help you get the right answer. If you're using Eclipse i recommend that you check that your Android SDK Tools Eclipse plug-in (ADT) is up to date.

ernestkamara
  • 75
  • 1
  • 9
1

This happens with me sometimes if I haven't chosen an android version in the top-right corner of the graphical layout editor. Because the same theme might look different in different versions of Android, I guess eclipse doesn't know what to show you unless you select a specific version of android for the theme you have chosen.

It also sometimes happens with me, If I have used a Google API's version instead of Android X.X version as target build for my project. Maybe some bug in the developer tools.

Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84
0

Try to increase -Xms128m -Xmx1024m when launch eclipse. I had the same problem because i don't have enough memory.

Hope this helps.

jzafrilla
  • 1,416
  • 3
  • 18
  • 41
0

Ok, so my best understanding is that you somehow overwrote or changed the default theme for that project with something other than AppTheme. You should be able to change that in the styles xml file (ProjectPath/res/values/styles.xml), assuming this is the same project.

For reference, mine works fine, and my project's styles.xml looks like this (new project):

<resources>

    <style name="AppTheme" parent="android:Theme.Light" />

</resources>
bplattenburg
  • 623
  • 1
  • 8
  • 33
0

In the eclipse, right click on your XML file and choose Open With and then XML Editor

At the bottom of the page, you'll see Design and Source tabs. Click on the Source to see what you desired.

Mohsen Afshin
  • 13,273
  • 10
  • 65
  • 90
0

mine never refreshes. So i open up another file then return back and then it refreshes. Even if i go to the palette to refresh it was not working. Also like others mentioned make sure your your api version is application to what you want rendered. So mine was set to api 20 but my project runs on api 17 so play with it. Heres a image:

enter image description here

notice how mines set to 17 - yours might be at 20 or something else that differs from your manifest. change it accordingly.

j2emanue
  • 60,549
  • 65
  • 286
  • 456
0

Solution for andoird Studio Users. Below solution worked for me.

File --> Invalidate Caches and Restart --> Invalidate and Restart.

Hope this will work for you too.