easycheese
easycheese

Reputation: 5899

Can't activate Preview mode Android Studio

I am trying to switch over to the new Android Studio (awesome btw) but I can' activate the "Preview" window to view my XML files like they demo'd in I/O.

When I navigate to View-->Tool Windows-->Preview 'Preview' is greyed out and I can't select it.

Does anyone know a fix for this?

Upvotes: 12

Views: 12369

Answers (4)

Sergiy Shilingov
Sergiy Shilingov

Reputation: 125

I had the same problem. Then I chose a different device. I saw the error window with the ability to click "rebuild". I clicked and it worked.

Screenshot here

Upvotes: 3

Shachi
Shachi

Reputation: 1888

What worked for me was changing the theme of the app.

Sometimes, parameters like Theme, Device preview, etc, can affect the preview although it may look well in the app.

Changing these helps. Can be accessed from design and text view.

Like these Params in Design View

Upvotes: 0

SaravanaRaja
SaravanaRaja

Reputation: 3406

Had the same problem, this solution worked for me File - Invalidate Caches/Restart

Upvotes: 3

Ricky Mau
Ricky Mau

Reputation: 11

Studio 2.2.1 / Build #AI-143.2821654, April 28, 2016.

Regarding: Missing the Preview Tab or grayed out Designer from View/Tool.

From the directory tree, click on the following directory to access activity_main.xml:

app/src/main/res/layout/activity_main.xml

or (depending on your directory structure, actual location may vary)

app/res/layout/activity_main.xml

Afterward, you should notice the Preview tab to the right.

To access Designer. You'll be able to find the Design|Text tab below your code.

P.S. My problem was the Designer was grayed out. After the fix, the Designer from Menu bar/View/Tool Window/Designer is still grayed out. But you should be able to access the designer anyway.

Screen Capture

Upvotes: 1

Related Questions