Allright, tnx, I will answet to it toomorrow (need a bit of thinking)
but i could ask yet one thing i do not understand in meantime
in oncreate in activity there is a line (80)
pongView = (PongTimeView)findViewById(R.id.pongview);
I do not understand this, pongView is an large object how you can just assign something to a large object - i would understand assigning something to a field of that but to a whole object - what is assigned here? does such assigning overvrite the left side, I mean previous state of an object - this line is strange to me; Can someone answer that?
(soory for font thuis changed after paste and i see no easy trick to change font tonormal)
pongView will store a reference to the view returned by findViewById. (R.id.pongview is a resource identifier so the view is most likely generated from an xml file)
if pongView allready had a reference to some other object the old reference would be dropped. (in this case that code should only run once when the activity starts).
consider this example
MyClass a = new MyClass(); MyClass b = a; //Now a and b reference the same object. a.someMember = 5; System.out.println(b.someMember) //This will print 5 since a and b are the same object. b = new MyClass(); //now b will reference a new object, a is unchanged. b.someMember = 10; System.out.println(a.someMember) //this will print 5 since a and b are different objects now a = b.Clone(); // this creates a copy of b and assigns its reference to a, the original object referenced by a is no longer referenced by anything and will be garbage collected eventually. (Most standard library classes implement the Clonable interface) System.out.println(a.someMember) //this prints 10 b.someMember = 15; System.out.println(a.someMember) //this still prints 10 since a and b are different objects now.