By BRaab


2019-12-02 22:04:59 8 Comments

addressF1 and addressRespuestas are ArrayLists intialized before the oncreate. After I try this method those array Lists are both empty. How can I solve this?

After I call this method, I use the log to check the array lists. Both are empty.

for (int i = 0; i < imagenesRespuestas.size(); i++) {
            addressF1 = new ArrayList<>();
            for (int j = 0; j < imagenesRespuestas.get(i).size(); j++) {

                final String fotoIdResps = imagenesRespuestas.get(i).get(j);

                if (!(fotoIdResps.equals("1")))
                {
                    storageReference.child(tit1).child(imagenesRespuestas.get(i).get(j)).putFile(Uri.parse(dataQuiz.getLinkRespuestasFotos().get(i)
                            .get(j))).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
                        @Override
                        public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {
                            if (!task.isSuccessful()) {
                                throw task.getException();
                            }

                            return storageReference.child(tit1).child(fotoIdResps).getDownloadUrl();
                        }
                    }).addOnCompleteListener(new OnCompleteListener<Uri>() {
                        @Override
                        public void onComplete(@NonNull Task<Uri> task) {

                            addressF1.add(task.getResult().toString());

                        }
                    });
                }
                else {
                    addressF1.add("1");
                }

            }
            addressRespuestas.add(addressF1);
        }

0 comments

Related Questions

Sponsored Content

7 Answered Questions

[SOLVED] Get image data url in JavaScript?

23 Answered Questions

[SOLVED] How to delete shared preferences data from App in Android

11 Answered Questions

[SOLVED] Saving image from PHP URL

  • 2009-04-07 06:50:46
  • riad
  • 689404 View
  • 386 Score
  • 11 Answer
  • Tags:   php image

17 Answered Questions

[SOLVED] How do I get extra data from intent on Android?

8 Answered Questions

[SOLVED] setText on button from another activity android

30 Answered Questions

[SOLVED] How do I obtain crash-data from my Android application?

3 Answered Questions

[SOLVED] How to get another Calendar result from same instance?

2 Answered Questions

1 Answered Questions

Sponsored Content