Why doesn't Picasso use imageView.getContext ()?

Stupid question:

If the context can be obtained from ImageView itself, why transmit it explicitly? what would be wrong if Picasso did something like this:

Picasso.load(url).into(imageView);

instead

Picasso.with(context).load(url).into(imageView);

?

+4
source share
2 answers

The context is used to initialize the disk cache, load local resources and interact with content providers, and intois not always called the action method. There's also get(), and fetch().

+10
source
ImageView imageView=(ImageView)header.findViewById(R.id.userImage);
Picasso.with(imageView.getContext()).load("https://secure.gravatar.com/avatar/#HASH#?s=64&d=mm&r=g").into(imageView);
-1
source

All Articles