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 Self-Destruction Deleting the Whole Message

Deletes before the image is downloaded.

Hi! I am having a problem where the image gets deleted even before the image is downloaded. I have decent internet speed and this can be a bug. So is there any fix to this??

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Absolutely! You can wait to start the timer until the image is downloaded. There is a callback method that you can use instead when downloading the image. Check out the into method that has a Callback as the 2nd parameter: http://square.github.io/picasso/javadoc/index.html

You'd want to start the timer in the onSuccess method of the callback.

Perfect!