I create a recyclerview with adapter, i use a ws that provide all the available merchants but i want to display only 4 element.
I had the idea of creating an empty array and fill it with the 4 element but an error appear " java.lang.ArrayIndexOutOfBoundsException: length=0; index=0"
how can i display only 4 element in recyclerview ?
the following code for adapter :
and this contain the activity :
Acetylsalicylic acid is aspirin. This could be handy too: