5
I was developing a slideshow loading images from Urls I found a library developed by a Russian, the Universal Image Loader, however this slideshow will be used in the application in the version of tablet. In the mobile version I use a listview.
The only problem is that the slideshow was giving error in version 3.0 which is precisely the minimum version for tablet.
I make the connection with the webservice and bring from the database the Urls that change constantly, then I use the pager and the library classes.
String[] imageUrls = new String[logos.size()];//logos é um List<String> que contem as urls
imageUrls = (String[]) logos.toArray(imageUrls);
//String[] imageUrls = bundle.getStringArray(Extra.IMAGES);
int pagerPosition = bundle.getInt(Extra.IMAGE_POSITION, 0);
if (savedInstanceState != null) {
pagerPosition = savedInstanceState.getInt(STATE_POSITION);
}
options = new DisplayImageOptions.Builder()
.showImageForEmptyUri(R.drawable.stub)
.showImageOnFail(R.drawable.stub)
.resetViewBeforeLoading(true)
.cacheOnDisc(true)
.imageScaleType(ImageScaleType.EXACTLY)
.bitmapConfig(Bitmap.Config.RGB_565)
.considerExifParams(true)
.displayer(new FadeInBitmapDisplayer(300))
.build();
pager = (ViewPager) findViewById(R.id.pager);
pager.setAdapter(new ImagePagerAdapter(imageUrls));
pager.setCurrentItem(pagerPosition);
Is there any other way to make a slideshow or some alternative, for example a grid well structured uploading images from Urls?
Picture of the error that is giving
Post the error so we can help. NOTE: you can use the Universal Image Loader inside Listview as well.
– lucasb.aquino
I use the UIL in a slide show including Froyo (2.2) without any problem. Post the error and we can help you.
– Androiderson