Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 611
easycheese Avatar asked May 19 '13 19:05

easycheese


People also ask

Can t see preview in Android Studio?

Try to 'Invalidate caches & restart'. Restart your Android Studio by choosing this option. It may take some time. Then, if still doesn't work try to rebuild your project.

Where can I find Activity_main XML?

While in the Android project view, navigate to res/layout/activity_main. xml.

Can t find Layout in Android Studio?

layout error is being caused by a mismatch between Android Studio's cache and your project's current layout. If you suspect this may be the case, then select File > Invalidate Caches / Restart > Invalidate and Restart from Android Studio's toolbar.


1 Answers

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

like image 189
Ricky Mau Avatar answered Oct 19 '22 01:10

Ricky Mau