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);
}
Related Questions
Sponsored Content
7 Answered Questions
[SOLVED] Get image data url in JavaScript?
- 2009-06-01 08:43:42
- Detariael
- 410551 View
- 326 Score
- 7 Answer
- Tags: javascript image firefox greasemonkey base64
23 Answered Questions
[SOLVED] How to delete shared preferences data from App in Android
- 2010-09-10 18:34:52
- Andrew
- 351243 View
- 456 Score
- 23 Answer
- Tags: android sharedpreferences
11 Answered Questions
17 Answered Questions
[SOLVED] How do I get extra data from intent on Android?
- 2010-11-20 16:59:59
- Adham
- 830987 View
- 720 Score
- 17 Answer
- Tags: android android-intent
8 Answered Questions
[SOLVED] setText on button from another activity android
- 2015-11-08 18:13:33
- Alan Santos
- 2578 View
- 5 Score
- 8 Answer
- Tags: java android android-intent settext
30 Answered Questions
[SOLVED] How do I obtain crash-data from my Android application?
- 2009-03-02 07:17:27
- pupeno
- 304511 View
- 730 Score
- 30 Answer
- Tags: android crash stack-trace
3 Answered Questions
2 Answered Questions
[SOLVED] How to Get Image URL after uploading an image form android to Firebase?
- 2017-06-21 21:35:11
- Aavgeen singh
- 4101 View
- 1 Score
- 2 Answer
- Tags: android image firebase firebase-storage
1 Answered Questions
[SOLVED] Firebase remote config condition by userId
- 2016-08-18 09:01:35
- noti
- 2340 View
- 7 Score
- 1 Answer
- Tags: android firebase firebase-authentication firebase-remote-config
0 comments