Nickthegoatboy Nickthegoatboy - 24 days ago 10
Android Question

Integer Array List Adding Elements

I'm having a bit of a problem with an ArrayList I'm trying to use for a clock deep link in Android. I'm just trying to create an ArrayList with the values [1,2,3,4,5,6,7].

Here's what I have right now:

ArrayList<Integer> daysList = new ArrayList<>();
daysList.add(5);


The
add
is underlined and says "Cannot resolve symbol: add"

Thanks in advance!

Answer

You should call daysList.add(5); in onCreate(); or some other method