Info about +1 code

Asmoro

Active Member
Licensed User
Longtime User
Hi All,

I'm examine an error in FlickrView demo.

If I have a sub:

B4X:
Sub ImageUrlDone (Url As String)
   ivs(ImageIndex).Bitmap = HttpUtils.GetBitmap(Url)
   ivs(ImageIndex).Gravity = Gravity.FILL
   ImageIndex = ImageIndex + 1
End Sub

What the +1 means in this case, cause the error log says:

java.lang.ArrayIndexOutOfBoundsException


If I delete the +1: all the images quickly went by.
And -1: one image will be displayed.

So why the +1 is working on the original FlickrView demo and
not in my Flickr test demo, causing an error.

The differences between the two are fetching the web url and "links.add"
 

pluton

Active Member
Licensed User
Longtime User
The error is here

ArrayIndexOutOfBoundsException

What is in your Array(). How many fields?
How many images do you fetching?
If I understood correct you have changed web url so it is not anymore flickr so you are trying to fetch maybe more images than is declared in array.
 
Last edited:
Upvote 0

Asmoro

Active Member
Licensed User
Longtime User
Hi Pluton,

Thanks helping me out.

It seems that the original FlickrView demo have 9 imageviews
in an array.

So I made a row of 3 x 3 on the website, and no errors came out.

Now I have to find out how to fetch another page with different images.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…