The application must download an image from the server and set it as an Activity. That's just the image does not have time to load and the background remains "by default"
My background is ImageView and I initialize it in the OnCreate method.
fon = new ImageView(this); and after that I try to install an image into it:
Picasso.with(getApplicationContext()).load(URL_BACKGROUND).into(fon); But Picasso loads it after the onCreate method onCreate worked and fon does not change.
UDP:
There is also such an option of loading the image and installing it as a background:
mTarget = new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { contentNav = (RelativeLayout) findViewById(R.id.content_navigation_drawer); contentNav.setBackground(new BitmapDrawable(getApplicationContext().getResources(), bitmap)); } @Override public void onBitmapFailed(final Drawable errorDrawable) { } @Override public void onPrepareLoad(final Drawable placeHolderDrawable) { } }; Picasso.with(getApplicationContext()).load(URL_BACKGROUND).into(mTarget); Only here the background is RelativeLayout and at the same time, the image is loaded very late and will not change at runtime but only after mTarget = new Target() called again
ImageViewprogrammatically, I do not know whether it will roll, but it seems, you need to either create in xml or programmatically, but something else is needed. Who is more experienced - correct me - Flippy