P Pommie Well-Known Member Most Helpful Member Mar 28, 2022 #1 I have an Android App that is in Java. I follow most of it but am confused at a particular piece of code. Namely, Code: protected void onDraw(Canvas c) { super.onDraw(c); if (DrawingClassArrayList.size() > 0) { c.drawPath( DrawingClassArrayList.get(DrawingClassArrayList.size() - 1).getPath(), DrawingClassArrayList.get(DrawingClassArrayList.size() - 1).getPaint()); } } How does DrawingClassArrayList.size ever change? Is it some kind of counter and if so, how? Mike.
I have an Android App that is in Java. I follow most of it but am confused at a particular piece of code. Namely, Code: protected void onDraw(Canvas c) { super.onDraw(c); if (DrawingClassArrayList.size() > 0) { c.drawPath( DrawingClassArrayList.get(DrawingClassArrayList.size() - 1).getPath(), DrawingClassArrayList.get(DrawingClassArrayList.size() - 1).getPaint()); } } How does DrawingClassArrayList.size ever change? Is it some kind of counter and if so, how? Mike.
rjenkinsgb Well-Known Member Most Helpful Member Mar 28, 2022 #2 Probably a linked list, that can have elements added and linked in as required? Linked list - Wikipedia en.wikipedia.org The actual code appears to be in the "DrawingClassArrayList" object.
Probably a linked list, that can have elements added and linked in as required? Linked list - Wikipedia en.wikipedia.org The actual code appears to be in the "DrawingClassArrayList" object.