Collectives on Stack Overflow. Learn more. Asked 4 years, 9 months ago. Active 2 years, 8 months ago. Viewed 1k times. Improve this question. Shorouk Adel Shorouk Adel 69 1 1 silver badge 16 16 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Cochi Cochi 2, 2 2 gold badges 10 10 silver badges 15 15 bronze badges. Hi, when i use your url , i have not image as well, can you try with this url : link — Cochi. The problem is that by doing the following in your Adapter: Glide.
Sign up or log in Sign up using Google. In the above code, we created an instance of LinearLayout to display the downloaded image. To simply load an image to LinearLayout, we call the with method of Glide class and pass the context, then we call the load method, which contains the URL of the image to be downloaded and finally we call the into method to display the downloaded image on our ImageView.
There are many other method that you can use in Glide library, some of those are fitCenter , centerCrop , etc. You can find them here. In this blog, we have seen how to use the Glide library to download and show an image in an ImageView. Images are loaded from the internet and we have given access for the App to connect the internet. All the complex work of loading and handling the images are done by the Glide library. So, without putting much effort, we learned how to handle images in our Andoird project and I am pretty sure that you will explore some more methods of Glide library.
Android Online Course for Professionals. Admin MindOrks 19th May Share this blog to spread the knowledge. Share on Facebook. Share on Twitter. Share on Reddit. Examples might be simplified to learn, reading and easy understanding. We cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use and privacy policy.
All Rights Reserved. Download and Save Image using Glide Android. Example of Glide. Add the support library to the dependency section. Glide ; import android. Manifest ; import android.
Intent ; import android. PackageManager ; import android. Bitmap ; import android.
0コメント