F Fillmore Member Licensed User Longtime User Dec 25, 2013 #1 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 gym gif.zip 58.1 KB · Views: 480
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
TomA Active Member Licensed User Longtime User Dec 26, 2013 #2 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
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
F Fillmore Member Licensed User Longtime User Dec 26, 2013 #3 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 Gym BLefort.zip 112.9 KB · Views: 478 Upvote 0
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 ! ++
TomA Active Member Licensed User Longtime User Dec 29, 2013 #4 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
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
F Fillmore Member Licensed User Longtime User Dec 29, 2013 #5 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
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