I have an array which is created in activity_1, and must be used in activity_2.
How did I do this ?
I created a class (array_provider.class) which will implement the getter and setter of this array.
So in activity_1, I initialise an object of array_provider then I used it to create my array.
In activity_2, I also initialise an object of array_provider then I used it to get my array.
BUT in activity_2, I got no array (size = 0) when I'm using array_provider.getArray()
even if in my activity_1 this array have a size of 7.
So I want to keep the same value of this array between activities.
I made some research before this question, and I found two options.
- SharedPreference => but putting an array is pretty tricky
- Subclass Application => not really adviced
Is there another solution ? Am I taking it wrong ?
Thanks a lot