I followed the example at http://www.emanueleferonato.com/2007/08/19/managing-ball-vs-ball-collision-with-flash/ to create ball collision on Android,
my code was organized as follows:

int N = 6; // number of balls
for (int i=0; i<N; i++) {
    // move ball
    // as in line 10~39

    // collision detection
    for(int j=i+1; j<N; j++) {
        // as in line 66~77
    } // end for
} // end for

However, sometimes my balls may stick together (overlap).
The same situation didn't happen in the example.
Why?
Do I need to start a thread for each ball?

Edit
Report