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

Justin Roberts
Justin Roberts
14,583 Points

No option for Navigation Type for Ribbit app in Eclipse

When first creating the project it says to set the Navigation Type when creating a new Blank Activity. There was no option displayed for me (I think I'm using the latest version of Eclipse), so I just went on with the instructions (not setting a Navigation Type).

Now I'm at the part in the tutorial where you're supposed to be creating the fragments and I'm missing a lot of the code due to not setting the Navigation Type when I first created the project. So I decided to just enter it manually, but I changed the first Activity declaration or whatever to implement ActionBar (public class MainActivity extends FragmentActivity implements ActionBar.TabListener) and it's telling me that ActionBar cannot be resolved. I organized imports and all, and can't seem to get it to resolve. Not to mention there is quite a bit of code added later.

Is there a way to get that Navigation Type option back? Then I can just copy all of my code into a new Project. Or any tips on how to get ActionBar to resolve? Then I can just copy the extra code from the videos.

3 Answers

Justin Roberts
Justin Roberts
14,583 Points

Okay, I think I figured it out. Instead of choosing Blank Activity (there are more options compared to the video, should have been my first indication), you select Tabbed Activity, then the Navigation Style will show up on the next screen, but now you have to choose Action Bar Tabs (with ViewPager). Then I just copied MainActivity and made all of the changes that were shown in the video to the MainActivity. Also had to change some of the imports (one that gave me trouble was I had to switch android.support.v4.app.FragmentPagerAdapter to android.support.v13.app.FragmentPagerAdapter and include the library). All seems to be fine now.

Oh, and just realized that's what you were trying to say Dekel. Sorry, was confused by exactly what you meant. The only part you left out was that you have to choose Tabbed Activity rather than Blank Activity before proceeding to that next screen (video tells you to choose blank activity).

Thanks, helped me too!

Dekel Zoaretz
Dekel Zoaretz
14,864 Points

hi, In the section that you define the name of the main activity, layout name and fragment name, down there choose the option named "Action bar Tabs (with ViewPager)". I hope that it helps

Justin Roberts
Justin Roberts
14,583 Points

Thanks for trying to help, but I was actually able to get it to resolve the ActionBar class by manually importing android.app.ActionBar. But now I'm facing other issues with the PagerAdapter and what not. Main thing is it's just turning out to be really difficult to manually switch the entire project over to the Navigation Type used in the video. Any idea how to get the Navigation Type back when creating a new project?