Question: I am trying to load an image from a URL into an `ImageView` using Picasso.

The image for the shared transition is inside a `CardView` in a `RecyclerView` and the second it just in a LinearLayout.
The first time the request is made the element doesn't animate as picasso needs to load the image into the view, but on subsequent requests it is fine.

How can I ensure that the `ImageView` has been successfully populated before initiating the transition?

Answer: 
The solution was in using the [`postponeEnterTransition()`](http://developer.android.com/reference/android/app/Activity.html#postponeEnterTransition()) and [`startPostponedEnterTransition()`](http://developer.android.com/reference/android/app/Activity.html#startPostponedEnterTransition()) calls to ensure that picasso has finished loading the image into the view before the activity starts.

[This](http://www.androiddesignpatterns.com/2015/03/activity-postponed-shared-element-transitions-part3b.html) is a great blog entry about this.

Below is an example of what you might use in `onCreate`

```
ActivityCompat.postponeEnterTransition(this);
Picasso.with(this.getApplicationContext())
    .load("https://goo.gl/oiyTor")
    .noFade()
    .fit()
    .centerInside()
    .error(R.drawable.user_placeholder_error)
    .into(((ImageView) findViewById(R.id.game_view_image)), new Callback() {
        @Override
        public void onSuccess() {
            ActivityCompat.startPostponedEnterTransition(targetActivity);
        }

        @Override
        public void onError() {
            ActivityCompat.startPostponedEnterTransition(targetActivity);
        }
    });

```
You can replace Picasso with Universal Image Loader which deals pretty well with this problem 

```
DisplayImageOptions options = new DisplayImageOptions.Builder()
                .showImageOnLoading(drawable) 
                .showImageForEmptyUri(emptyDrawable) 
                .showImageOnFail(errorDrawable) 
                .resetViewBeforeLoading(false)  
                .cacheInMemory(true) 
                .cacheOnDisk(true) 
                .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
                .build();
        imageLoader.displayImage(url, iv, options);

```