A context is used to initialize the disk cache, load local resources, and communicate with content providers and into
isn't always the action method that's invoked. There's also get()
and fetch()
.
Why Picasso is not using imageView.getContext()?
-
01-07-2022 - |
Question
Stupid question:
if context can be obtained from imageView itself, why bother passing it explicitly? what would be wrong if Picasso did something like this:
Picasso.load(url).into(imageView);
instead of
Picasso.with(context).load(url).into(imageView);
?
Solution
OTHER TIPS
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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow