Android - picasso only shows placeholder, not image from url

I have this code

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ImageView image_view = (ImageView)findViewById(R.id.imageView1);

        Picasso.with(getApplicationContext()).load("http://nuclearpixel.com/content/icons/2010-02-09_stellar_icons_from_space_from_2005/earth_128.png").placeholder(R.drawable.ic_launcher).noFade().into(image_view);
    }

And I want to view the image from the URL in my image ... however, instead of the image, only the placeholder is displayed. What could be the problem?

+4
source share
1 answer

Try using only picasso.load () instead of Picasso.with ()

Something like that:

Picasso.Builder builder = new Picasso.Builder(getApplicationContext());
Picasso picasso = builder.build();
picasso.load("http://nuclearpixel.com/content/icons/2010-02-09_stellar_icons_from_space_from_2005/earth_128.png").placeholder(R.drawable.ic_launcher).noFade().into(image_view);
+2
source

All Articles