5

I'm working on resizing and changing background images. However, each time I have to restart Android Studio so the Layout Preview will refresh the image.

Doesn't work:

  • Changing API level
  • Changing Preview orientation
  • Changing theme
  • Synchronizing project

What else can I do?

On Android Studio 2.2.2, Windows 10 64-bit on AMD A8-6410 with AMD Radeon R5 Graphics, 11 GB of RAM.

Ali Bdeir
  • 4,151
  • 10
  • 57
  • 117

1 Answers1

3

If you're on pre-Android Studio 2.2: just hit the refresh button on the menu bar of the layout editor.

Otherwise:

Go to the layout you're working on. Then, change any resource to an incorrect name.

For example, if you have a button with this attribute:

android:background="@drawable/button"

Replace it with any random false resource:

android:background="@drawable/thisIsSomethingVeryRandomAndDoesntExist"

Then, you'll get something similar to this:

image

Click the "Refresh" (Sometimes "Clear Cache"), then go and undo the changes you did with the attribute. Voila!

Sometimes even changing the orientation works.

Source

Community
  • 1
  • 1
Ali Bdeir
  • 4,151
  • 10
  • 57
  • 117