Can't load image with Picasso (Android)Is there a way to run Python on Android?How do save an Android Activity state using save instance state?Strange out of memory issue while loading an image to a Bitmap objectLazy load of images in ListViewClose/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?Is there a unique Android device ID?What is 'Context' on Android?How to vertically align an image inside a div?Proper use cases for Android UserManager.isUserAGoat()?

How are one-time password generators like Google Authenticator different from having two passwords?

Do atomic orbitals "pulse" in time?

What does a comma mean inside an 'if' statement?

Does the 500 feet falling cap apply per fall, or per turn?

Was this character’s old age look CGI or make-up?

What to do if SUS scores contradict qualitative feedback?

How to compact two the parabol commands in the following example?

How to make a language evolve quickly?

Can the sorting of a list be verified without comparing neighbors?

Front derailleur hard to move due to gear cable angle

Surely they can fit?

Why does the Earth follow an elliptical trajectory rather than a parabolic one?

What is the best way for a skeleton to impersonate human without using magic?

How to minimise the cost of guessing a number in a high/low guess game?

How does Howard Stark know this?

Create a list of all possible Boolean configurations of three constraints

What stroke width Instagram is using for its icons and how to get same results?

How to prevent cooked noodles & dumplings from getting soggy

Size of a folder with du

How does noise-cancellation work in Mac laptops?

When a land becomes a creature, is it untapped?

Who was this character from the Tomb of Annihilation adventure before they became a monster?

Extracting sublists that contain similar elements

Run script for 10 times until meets the condition, but break the loop if it meets the condition during iteration



Can't load image with Picasso (Android)


Is there a way to run Python on Android?How do save an Android Activity state using save instance state?Strange out of memory issue while loading an image to a Bitmap objectLazy load of images in ListViewClose/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?Is there a unique Android device ID?What is 'Context' on Android?How to vertically align an image inside a div?Proper use cases for Android UserManager.isUserAGoat()?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-1















I'm trying to display an image in an ImageView with the Picasso Library but I don't know why the image doesn't load. Can you help me please ?



In the build.gradle (dependencies) :



implementation 'com.squareup.picasso:picasso:2.71828'


In the MainActivity.java :



package com.example.imageview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

public class MainActivity extends AppCompatActivity

ImageView imageView;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = (ImageView) findViewById(R.id.imageView);
Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);




In the AndroidManifest.xml :
(I don't know if it's really necessary)



<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


In the activity_main.xml :



<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="154dp">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="200dp"
android:src="#A0A" />

</RelativeLayout>
</android.support.constraint.ConstraintLayout>


I would like just display the image with the url like in the Picasso's documentation. Did i forget something ? Or change something in settings ?



Thank you !










share|improve this question
























  • show your activity_main

    – NullPointerException
    Mar 23 at 12:11











  • The code that you have posted works as expected. Please add your activity_main.xml to the post. Also check if your device (or emulator) has internet connection.

    – Daniel Spiess
    Mar 23 at 12:21











  • Sorry i forget the xml I edited it.

    – Thomas
    Mar 23 at 12:33











  • Yes the device has internet connection I can search in Google Chrome

    – Thomas
    Mar 23 at 12:34











  • Try to add .placeHolder(...), .error(...) to Picasso call for reserach the problem

    – Vladyslav Ulianytskyi
    Mar 23 at 13:56


















-1















I'm trying to display an image in an ImageView with the Picasso Library but I don't know why the image doesn't load. Can you help me please ?



In the build.gradle (dependencies) :



implementation 'com.squareup.picasso:picasso:2.71828'


In the MainActivity.java :



package com.example.imageview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

public class MainActivity extends AppCompatActivity

ImageView imageView;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = (ImageView) findViewById(R.id.imageView);
Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);




In the AndroidManifest.xml :
(I don't know if it's really necessary)



<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


In the activity_main.xml :



<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="154dp">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="200dp"
android:src="#A0A" />

</RelativeLayout>
</android.support.constraint.ConstraintLayout>


I would like just display the image with the url like in the Picasso's documentation. Did i forget something ? Or change something in settings ?



Thank you !










share|improve this question
























  • show your activity_main

    – NullPointerException
    Mar 23 at 12:11











  • The code that you have posted works as expected. Please add your activity_main.xml to the post. Also check if your device (or emulator) has internet connection.

    – Daniel Spiess
    Mar 23 at 12:21











  • Sorry i forget the xml I edited it.

    – Thomas
    Mar 23 at 12:33











  • Yes the device has internet connection I can search in Google Chrome

    – Thomas
    Mar 23 at 12:34











  • Try to add .placeHolder(...), .error(...) to Picasso call for reserach the problem

    – Vladyslav Ulianytskyi
    Mar 23 at 13:56














-1












-1








-1








I'm trying to display an image in an ImageView with the Picasso Library but I don't know why the image doesn't load. Can you help me please ?



In the build.gradle (dependencies) :



implementation 'com.squareup.picasso:picasso:2.71828'


In the MainActivity.java :



package com.example.imageview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

public class MainActivity extends AppCompatActivity

ImageView imageView;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = (ImageView) findViewById(R.id.imageView);
Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);




In the AndroidManifest.xml :
(I don't know if it's really necessary)



<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


In the activity_main.xml :



<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="154dp">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="200dp"
android:src="#A0A" />

</RelativeLayout>
</android.support.constraint.ConstraintLayout>


I would like just display the image with the url like in the Picasso's documentation. Did i forget something ? Or change something in settings ?



Thank you !










share|improve this question
















I'm trying to display an image in an ImageView with the Picasso Library but I don't know why the image doesn't load. Can you help me please ?



In the build.gradle (dependencies) :



implementation 'com.squareup.picasso:picasso:2.71828'


In the MainActivity.java :



package com.example.imageview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

public class MainActivity extends AppCompatActivity

ImageView imageView;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = (ImageView) findViewById(R.id.imageView);
Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);




In the AndroidManifest.xml :
(I don't know if it's really necessary)



<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


In the activity_main.xml :



<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="154dp">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="200dp"
android:src="#A0A" />

</RelativeLayout>
</android.support.constraint.ConstraintLayout>


I would like just display the image with the url like in the Picasso's documentation. Did i forget something ? Or change something in settings ?



Thank you !







android image url picasso






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 12:32







Thomas

















asked Mar 23 at 12:03









ThomasThomas

32




32












  • show your activity_main

    – NullPointerException
    Mar 23 at 12:11











  • The code that you have posted works as expected. Please add your activity_main.xml to the post. Also check if your device (or emulator) has internet connection.

    – Daniel Spiess
    Mar 23 at 12:21











  • Sorry i forget the xml I edited it.

    – Thomas
    Mar 23 at 12:33











  • Yes the device has internet connection I can search in Google Chrome

    – Thomas
    Mar 23 at 12:34











  • Try to add .placeHolder(...), .error(...) to Picasso call for reserach the problem

    – Vladyslav Ulianytskyi
    Mar 23 at 13:56


















  • show your activity_main

    – NullPointerException
    Mar 23 at 12:11











  • The code that you have posted works as expected. Please add your activity_main.xml to the post. Also check if your device (or emulator) has internet connection.

    – Daniel Spiess
    Mar 23 at 12:21











  • Sorry i forget the xml I edited it.

    – Thomas
    Mar 23 at 12:33











  • Yes the device has internet connection I can search in Google Chrome

    – Thomas
    Mar 23 at 12:34











  • Try to add .placeHolder(...), .error(...) to Picasso call for reserach the problem

    – Vladyslav Ulianytskyi
    Mar 23 at 13:56

















show your activity_main

– NullPointerException
Mar 23 at 12:11





show your activity_main

– NullPointerException
Mar 23 at 12:11













The code that you have posted works as expected. Please add your activity_main.xml to the post. Also check if your device (or emulator) has internet connection.

– Daniel Spiess
Mar 23 at 12:21





The code that you have posted works as expected. Please add your activity_main.xml to the post. Also check if your device (or emulator) has internet connection.

– Daniel Spiess
Mar 23 at 12:21













Sorry i forget the xml I edited it.

– Thomas
Mar 23 at 12:33





Sorry i forget the xml I edited it.

– Thomas
Mar 23 at 12:33













Yes the device has internet connection I can search in Google Chrome

– Thomas
Mar 23 at 12:34





Yes the device has internet connection I can search in Google Chrome

– Thomas
Mar 23 at 12:34













Try to add .placeHolder(...), .error(...) to Picasso call for reserach the problem

– Vladyslav Ulianytskyi
Mar 23 at 13:56






Try to add .placeHolder(...), .error(...) to Picasso call for reserach the problem

– Vladyslav Ulianytskyi
Mar 23 at 13:56













3 Answers
3






active

oldest

votes


















0














Your url is not working,



Try this;



Picasso.get().load("https://www.gstatic.com/webp/gallery/4.sm.jpg").into(imageView);



instead of



Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);






share|improve this answer























  • Oh thank you ! I don't know why Picasso let this url on the documentation ...

    – Thomas
    Mar 23 at 22:44


















0














Replace below. Pass the Activity reference into picasso.



 Picasso.with(MainActivity.this) 
.load("http://i.imgur.com/DvpvklR.png").into(imageView);





share|improve this answer























  • The method with() is not avalaible with this implementation but thank you for your help

    – Thomas
    Mar 23 at 22:46



















0














Remove the




android:src="#A0A"




from your activity_main.xml. You don't need to put any source in the xml, you can do that with



.load.....
.placeholder(R.drawable.user_placeholder) // Image to show before loading url of image
.error(R.drawable.user_placeholder_error) // Image to show is error occurred while loading url





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313544%2fcant-load-image-with-picasso-android%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Your url is not working,



    Try this;



    Picasso.get().load("https://www.gstatic.com/webp/gallery/4.sm.jpg").into(imageView);



    instead of



    Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);






    share|improve this answer























    • Oh thank you ! I don't know why Picasso let this url on the documentation ...

      – Thomas
      Mar 23 at 22:44















    0














    Your url is not working,



    Try this;



    Picasso.get().load("https://www.gstatic.com/webp/gallery/4.sm.jpg").into(imageView);



    instead of



    Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);






    share|improve this answer























    • Oh thank you ! I don't know why Picasso let this url on the documentation ...

      – Thomas
      Mar 23 at 22:44













    0












    0








    0







    Your url is not working,



    Try this;



    Picasso.get().load("https://www.gstatic.com/webp/gallery/4.sm.jpg").into(imageView);



    instead of



    Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);






    share|improve this answer













    Your url is not working,



    Try this;



    Picasso.get().load("https://www.gstatic.com/webp/gallery/4.sm.jpg").into(imageView);



    instead of



    Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 23 at 22:01









    YZEYZE

    161




    161












    • Oh thank you ! I don't know why Picasso let this url on the documentation ...

      – Thomas
      Mar 23 at 22:44

















    • Oh thank you ! I don't know why Picasso let this url on the documentation ...

      – Thomas
      Mar 23 at 22:44
















    Oh thank you ! I don't know why Picasso let this url on the documentation ...

    – Thomas
    Mar 23 at 22:44





    Oh thank you ! I don't know why Picasso let this url on the documentation ...

    – Thomas
    Mar 23 at 22:44













    0














    Replace below. Pass the Activity reference into picasso.



     Picasso.with(MainActivity.this) 
    .load("http://i.imgur.com/DvpvklR.png").into(imageView);





    share|improve this answer























    • The method with() is not avalaible with this implementation but thank you for your help

      – Thomas
      Mar 23 at 22:46
















    0














    Replace below. Pass the Activity reference into picasso.



     Picasso.with(MainActivity.this) 
    .load("http://i.imgur.com/DvpvklR.png").into(imageView);





    share|improve this answer























    • The method with() is not avalaible with this implementation but thank you for your help

      – Thomas
      Mar 23 at 22:46














    0












    0








    0







    Replace below. Pass the Activity reference into picasso.



     Picasso.with(MainActivity.this) 
    .load("http://i.imgur.com/DvpvklR.png").into(imageView);





    share|improve this answer













    Replace below. Pass the Activity reference into picasso.



     Picasso.with(MainActivity.this) 
    .load("http://i.imgur.com/DvpvklR.png").into(imageView);






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 23 at 21:21









    Bhavesh ShiyaniBhavesh Shiyani

    654




    654












    • The method with() is not avalaible with this implementation but thank you for your help

      – Thomas
      Mar 23 at 22:46


















    • The method with() is not avalaible with this implementation but thank you for your help

      – Thomas
      Mar 23 at 22:46

















    The method with() is not avalaible with this implementation but thank you for your help

    – Thomas
    Mar 23 at 22:46






    The method with() is not avalaible with this implementation but thank you for your help

    – Thomas
    Mar 23 at 22:46












    0














    Remove the




    android:src="#A0A"




    from your activity_main.xml. You don't need to put any source in the xml, you can do that with



    .load.....
    .placeholder(R.drawable.user_placeholder) // Image to show before loading url of image
    .error(R.drawable.user_placeholder_error) // Image to show is error occurred while loading url





    share|improve this answer



























      0














      Remove the




      android:src="#A0A"




      from your activity_main.xml. You don't need to put any source in the xml, you can do that with



      .load.....
      .placeholder(R.drawable.user_placeholder) // Image to show before loading url of image
      .error(R.drawable.user_placeholder_error) // Image to show is error occurred while loading url





      share|improve this answer

























        0












        0








        0







        Remove the




        android:src="#A0A"




        from your activity_main.xml. You don't need to put any source in the xml, you can do that with



        .load.....
        .placeholder(R.drawable.user_placeholder) // Image to show before loading url of image
        .error(R.drawable.user_placeholder_error) // Image to show is error occurred while loading url





        share|improve this answer













        Remove the




        android:src="#A0A"




        from your activity_main.xml. You don't need to put any source in the xml, you can do that with



        .load.....
        .placeholder(R.drawable.user_placeholder) // Image to show before loading url of image
        .error(R.drawable.user_placeholder_error) // Image to show is error occurred while loading url






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 10 hours ago









        Yusuf folahanYusuf folahan

        434




        434



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313544%2fcant-load-image-with-picasso-android%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현