Android Question Problem with Gif Decoder Library

Fillmore

Member
Licensed User
Longtime User
Hello guys,

I've posted my problem on the tread about the Gif Decoder library, but no answer yet. I think it will be more visible here.

I've got a problem with the gif decoder library.
In the following app, if I check "G" and "A" and click the button "1", it works. After this, if I check "B" and click again on the button "1", it crash with this error message : " java.lang.ArrayIndexOutOfBoundsException: length=47400; index=47400 "

I don't found why...

Thanks a lot and merry Christmas !.


Fred
 

Attachments

  • gym gif.zip
    58.1 KB · Views: 201

TomA

Active Member
Licensed User
Longtime User
You did not include the .gif files with the program so we cannot really check it out - need ga1.gif, gb1.gif and gc1.gif
 
Upvote 0

Fillmore

Member
Licensed User
Longtime User
Thanks TomA,

I tought, it was included in the zip (generated with B4A). Now it's good.

If I click 1 and 2 and 3, it crash, but if if click 3, 2, 1, 2, 3..., it works. It crash only when I begin with the ga1.gif.

Thanks again !

++
 

Attachments

  • Gym BLefort.zip
    112.9 KB · Views: 186
Upvote 0

TomA

Active Member
Licensed User
Longtime User
Sorry I didn't get back to this sooner. Don't know if you solved the problem, but I did some searching and found a post that says "You need to use a new instance of GifDecoder for each image" - see http://www.b4x.com/android/forum/th...ayindexoutofboundsexception.11312/#post-63223

Based on that post, I added one line to your program and it seems to work OK. In the sub img_load, I added the line as shown below.

Sub img_load
gif.DisposeFrames
' Added this code
Dim gif As GifDecoder
' End of addition
....rest of code unchanged...

With that change, I can get it to execute images in any order with no problem.

By the way, in Activity_Create, you initialize the time every time that executes. You should place that in a conditional so it is only initialized the first time through:

If FirstTime Then
Timer1.Initialize("Timer1",0)
End If
 
Upvote 0

Fillmore

Member
Licensed User
Longtime User
Thanks a lot for your answer ! I haven't seen the thread about this problem :-(
Now it works fine ! I can finish my appli now :)

Happy end of the year !

Thanks again.

Fred
 
Upvote 0
Top