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