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

Need help, android

I need to start an activity from a fragment. For example, "Build a Self-Destructing Message Android App" project it has two fragments, inbox and friendsfragment. I was wondering how to make an intent from friendsfragment to new activity. Like, when I tap someone on my friendsfragment I would like to see new activity open.

see here: http://i.imgur.com/TZVkS5l.png I really like to see someone help me out this, I have been trying to make this thing worked for long time.

Ribbit project file ZIP: http://treehouse-code-samples.s3.amazonaws.com/Android/RibbitDesign_s8v6.zip

for more information, contact me through email: olow 304 at gmail dot com

Thanks everyone!

1 Answer

In your click listener, launch an intent to the activity you want to start:

Intent i = new Intent(getActivity(), ActivityToStart.class);
startActivity(i);