Im Picasso.with(context)
..Warum in Picasso.mit (Kontext) fragt Picasso nach Kontext?
public static Picasso with(Context context) {
if (singleton == null) {
synchronized (Picasso.class) {
if (singleton == null) {
singleton = new Builder(context).build();
}
}
}
return singleton;
}
Und der Baumeister (Context Kontext) wie folgt
/** Start building a new {@link Picasso} instance. */
public Builder(Context context) {
if (context == null) {
throw new IllegalArgumentException("Context must not be null.");
}
this.context = context.getApplicationContext();
}
Warum ist Picasso selbst für einen Zusammenhang zu fragen, wenn es immer setting context = context.getApplicationContext()
ist?
Es verhindert auch, dass eine "Aktivität" (wenn es das ist, was du passierst) durch einen Wechsel in den Anwendungskontext verlieren. –
Vielen Dank @JakeWharton für die Klarheit! –