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.

Android Build a Self-Destructing Message Android App Retrieving and Viewing Messages Using Picasso to View Images from the Web

Ricky Sparks
Ricky Sparks
22,249 Points

What is this code challenge asking for?

In this challenge you want to download and view an image from the web using Picasso. Start by declaring an ImageView named userImageView and set it using findViewById(). The code below runs inside an Activity, and you can use R.id.userImageView as the ID.

// This code is excerpted from an Activity
ImageView userImageView = new ImageView(findViewById());

How did you pass challenge 6? I keep getting a compile error Here is my code:

ImageView userImageview = (ImageView)findViewById(R.id.userImageView); Intent intent = getIntent(); Uri imageUri = getIntent().getData(); Picasso.with(this).load(imageUri.toString()).into(userImageView);

1 Answer

In this case you are not declaring an image view you are assigning the Image view named userImageView to an ImageView which is already in your resources with and ID of userImageView. Below is what the quiz is looking for.

ImageView userImageView = findViewById(R.id.userImageView);

Ricky Sparks
Ricky Sparks
22,249 Points

I got through all of the 6 challenges found out that all I needed to do for my project was Add as Library