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 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.

CodeChallenge.java
// 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