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


Mark Junge
Mark Junge
1,374 Points


I have used about 5 hours to figure this out.

I have one activity with a textview and two buttons. The activity have to start with a random text and for every tab on one of the two buttons I will like to have a random generator to get new text to the view. But only for four times more (four clicks).

I have found out how to make random generator and keep getting new text on the view for every click i make, but I cant get it to stop after 4 times, and actually I want it to get back to the last activity when this activity is done (after 4 clicks and 5 different strings in the textview). I also know how to get back to the last activity, but just not at the right time :-(

I think the huge problem is, which loops to choose and how to combine them? I have a feeling it can be done much more simple than I think, i am just a little frustrated.

I hope i am clear enough on this one, thank you for your time

Kind regards Mark

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hi Mark,

can you share the code with us?