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

Useing intents to share data code chalenge 1/4

Inside the 'if' block, declare a new Intent variable and initialize it as a Share Intent.

i dont understand what im doing wrong that i cant pass.

/* This code is an excerpt from the onOptionsItemSelected() 
 * method of a custom Activity class.
 */
int itemId = item.getItemId();

if (itemId == R.id.action_share) {
    // Add code here!
Intent shareIntent = new intent(Intent.ACTION_SEND);
}

Thanks for your time. Ziga :D

3 Answers

I don't know if that is the problem, but try new Intent instead of new intent. I.e. Intent shareIntent = new Intent(Intent.ACTION_SEND);

Yea that worked fine :D i don't know how i could missed that xD

Again thanks for your time and help :D

No problem, I'm glad I could help ;)