I recently use this code, and realize that in anonymous class, I can't access the instance by .this, like this:
Sprite sprFace = new Sprite() {
@Override
protected void onManagedUpdate(float pSecondElapsed) {
runOnUpdateThread(new Runnable() {
@Override
protected void run() {
Sprite.this.getParent().detach(Sprite.this); // Here
}});
}
};
I know how to solve it (just declare a "me" variable), but I need to know why I can't use <Class>.this
?