Perhaps a frequent problem of many, but alas, I did not find the answer. And the problem, or rather the error is the following:

java.lang.RuntimeException: Failure delivering result ResultInfo {who = null, request = 65551, result = -1, data = Intent {(has extras)}} to activity {md.site.md/md.site.md.activities .Activity_Md}: java.lang.IndexOutOfBoundsException: Invalid index 22, size is 4 at android.app.ActivityThread.deliverResults (ActivityThread.java.0635)

Well, it also highlights errors in specific lines.

  1. In the fragment service.upload1(file1, str, stringMap, new CancelableCallback(mSelectPath.get(position)) {
  2. uploadPhoto(mSelectPath, position, controlList.get(position).getImageUploads().size() - 1);
  3. In super.onActivityResult(requestCode, resultCode, data);

It is possible to understand some moments is not enough, please clarify in the comments (I’ll add everything you need).

  • Is a stackTrace indicated on which specific line it falls? Show how you and with what setResult call \ - Yuriy SPb
  • @Yuriy SPb Yes, I indicated those lines in the lists. Please specify the second part of the question, are you interested in how the onActivityResult method is implemented? Or I somehow misunderstood. - Inkognito
  • The information you provided is not enough. You have somewhere going beyond the bounds of the array. Probably you are doing something wrong somewhere. And you need a code where you apparently put the data in Intent - YuriySPb
  • You are trying to get a non-existing element with index 22 from the list, in which there are only 4 elements - mSelectPath.get(position) , or controlList.get(position) - Vladyslav Matviienko

0