Android Question Remove all images from gridview

Douglas Farias

Licensed User
Longtime User
Hi i m using the B4aGridView to get a list of images of the web.

this is working show the images on the app but i dont know how to remove from the screen.
i m want to show only 4 images on the screen like imagedownloader sample, when press a button show 4 diferent photos, press again clear the 4 current photos and add new 4 photos etc

i m trying to use this code to get all views and clear this, i think the code is correct but i have error all time *-*
here is the code
If    GridView.Length > 0 Then
    For i=0 To  GridView.Length - 1
    GridView.RemoveAt = i
    End If

The error log
4 Photos
java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
at java.util.ArrayList.throwIndexOutOfBoundsException(
at java.util.ArrayList.remove(
at it.giuseppe.salvi.gridview.library.core.adapter.GridViewAdapterWrapper.Remove(
at it.giuseppe.salvi.gridview.library.core.GridViewActivityWrapper.setRemoveAt(
at click.fight.vallow.telaprincipal._jobdone(
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(
at anywheresoftware.b4a.BA.raiseEvent2(
at anywheresoftware.b4a.keywords.Common$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(
at dalvik.system.NativeStart.main(Native Method)

what can i make to clear the 4 images at the grid and add 4 diferent new photos?