0

I have a list declared in my mainactivity, also calling the service from there but I have encountered some problems with trying to add items to the list I have from my service.

A little background, my service is doing some fetching of data and I save the response to a list I have in my main activity.

Currently, I'm doing it like this:

Activity activity = new Activity();
activity.addError(error);

My main activity is like this:

List<String> errorList = new ArrayList<>();    
public void addError(String error) {
    errorList.add(error);
}

I'm really quite not sure with all of this. I hope you can help. Thank you.

Tenten Ponce
  • 2,436
  • 1
  • 13
  • 40
fandomfox
  • 35
  • 2
  • 9

1 Answers1

0

I was able to solve the problem by referring to this helpful post. Hopefully this can help you too.

fandomfox
  • 35
  • 2
  • 9