I'm creating a android application. When I tested in Emulator, Samsung S8 Plus and General Mobile GM8, I haven't any error but play console always gives me some crushes.
Code is:
int count = getItemCount() >= 30 ? 30 : getItemCount();
if (count == 0)
return new long[] {0};
long[] result = new long[count];
for (int i = 0; i < count; i++)
result[i] = users.get(i).getPk();
return result;
Error message: ArrayIndexOutOfBoundsException
How I can fix it I really do not know.