Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

princess mudyahoto
18,502 Pointsshare intents
Challenge Task 1 of 4
Let's write a Share Intent that shares the Treehouse website with available apps on the user's device. Create a new Intent variable, and initialize it as a Share Intent.
String textToShare = "Learn something new at www.teamtreehouse.com";
// YOUR CODE HERE
shareIntent intent= new ShareIntent();
3 Answers

Seth Kroger
56,403 PointsIntents usually don't come in different subtypes. You create an vanilla Intent passing in a constant for the action you intend to perform. (One extra hint. there isn't a "share" action but there is a "send" action which amounts to the same thing.)

TERRENCE MAVHUNGA
6,053 PointsIntent shareIntent = new Intent(Intent.ACTION_SEND);

princess mudyahoto
18,502 Pointsthnx Terry best answer ever but now im on task 3 on share intents but here is my answer please correct me
Intent.putTextToShare( Intent.EXTRA_TEXT);

princess mudyahoto
18,502 PointsFINALLY I GOT IT Intent.putExtra(Intent.EXTRA_TEXT, textToShare);
princess mudyahoto
18,502 Pointsprincess mudyahoto
18,502 Pointsdangie kroger fo helping me out. now stuck on task 3 of 4 on ShareIntents here is what i wrote Intent.putTextToShare( Intent.EXTRA_TEXT); but um getting 1 error