Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App (Retired) The Model-View-Controller Pattern Creating the Story

Won't import page class

android studio doesn't recognize or show Page class when I try to import using alt + enter. It always imports the PDF class.

private Page mPage [];

3 Answers

Gašper Sladič
Gašper Sladič
1,891 Points

Had the same problem. Android Studio (version 1.1.0) messed up the file hierarchy after creating the "ui" package under "java"-> "yourdomainname.interactivestory". You have to open the "java" folder in finder (on mac) and reorganize folder structure manually. After this, it works as it should.

Have you created the Page class and put it in the correct place? Maybe you need to try cleaning the project via Build -> Clean?

If neither of those are the issue, you can always type in the import by hand, assuming this is where you have your Page class:

import com.yournamehere.interactivestory.model.Page;

Yes I believe I did, I created a page class under model. I rewatched the videos, and continued on. Once I created the Story class, and added private Page[] mPages; it imported correctly. Wonder if I had something hung up in the Page class? I had previously 'cleaned' the project.

Hmm that's weird. It's hard to say what happened without being able to see it, but I'm glad you got it figured out!