Android: sampledata subdirectories not showing up in Android Studio 3.X

1k Views Asked by At

I am trying to create UI preview using tools:text in my layout.xml

For the files inside the sampledata directory. I am able to reference them in xml and see them in preview But for files inside the sampledata subdirectory i am not able to access them in xml nor i can see the preview as shown in the image below.

What am i doing wrong. Is this even possible ?

Problem Image

2

There are 2 best solutions below

0
On

I had the same problem and restarting the Android Studio solved the problem.

After this, just compiling the project shows the latest changes.

I'm using Android Studio 3.2.1

0
On

It could happen also that the sampledata folder is not inside the same module as it is the layout.

Then, just move the sampledata folder to the module that contains the layout.