android java array push

Solutions on MaxInterview for android java array push by the best coders in the world

showing results for - "android java array push"
Julian
05 Jan 2017
1Use an ArrayList paramaterized to any type you want
2
3ArrayList<Integer> iconList = new ArrayList<Integer>();
4
5add with
6
7iconList.add(Integer.parseInt(cursor.getString(0)));
8
9Iterate with
10
11for (int i: iconList)
12{
13    // i is your entire array starting at index 0
14}
15or
16
17for (int i=0; i< iconList.size(), i++)
18{
19
20}