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); // ΠΠ°ΠΏΡΡΡΠΈΠ»ΠΈ Π°ΡΠΈΠ½Ρ
ΡΠΎΠ½Π½ΡΠΉ ΠΏΠΎΠΊΠ°Π· ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΈ