I added the code as http://nostra13android.blogspot.com/2012/03/5-universal-image-loader-part-2.html writes here, and an error occurs: red with red ImageView imageView = "mImg1"; and writes Incompatible types. Required: android.widget.ImageView Found: java.lang.String Incompatible types. Required: android.widget.ImageView Found: java.lang.String changed ImageView imageView = (ImageView)findViewById(R.id.mImg1); for ImageView imageView = (ImageView)findViewById(R.id.mImg1); but still the picture is not shown!

 // Create global configuration and initialize ImageLoader with this config ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).build(); ImageLoader.getInstance().init(config); mManager = getSupportFragmentManager(); ImageView imageView = "mImg1"; // <-- ошибка здСсь!! Π²ΡŒΡŽΡ…Π°, Π³Π΄Π΅ Π±ΡƒΠ΄Π΅Ρ‚ ΠΎΡ‚ΠΎΠ±Ρ€Π°ΠΆΠ°Ρ‚ΡŒ ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΡƒ String imageUrl = "http://Ρ‚ΡƒΡ‚.ΠΌΠΎΠΉ.сайт/image.png"; // URL ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠΈ (Π½-Ρ€: "http://site.com/image.png", "file:///mnt/sdcard/img/image.jpg") ImageLoader imageLoader = ImageLoader.getInstance(); // ΠŸΠΎΠ»ΡƒΡ‡ΠΈΠ»ΠΈ экзСмпляр imageLoader.init(ImageLoaderConfiguration.createDefault(this)); // ΠŸΡ€ΠΎΠΈΠ½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·ΠΈΡ€ΠΎΠ²Π°Π»ΠΈ ΠΊΠΎΠ½Ρ„ΠΈΠ³ΠΎΠΌ ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ imageLoader.displayImage(imageUrl, imageView); // Запустили асинхронный ΠΏΠΎΠΊΠ°Π· ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠΈ 
  • Those. is your problem solved? - Yuriy SPb ♦
  • @Yuriy SPb, no picture is displayed ((( - Andrew

1 answer 1

Why do you do everything so badly, on the 21st century street, there is the best Picasso library, nothing is needed. You write 1 line Url and that's it, the picture is loaded into the cache. Read about Picasso and you'll see how easy it is to use.