Inner classes: Android vs Java
<p>I'm aware that inner classes are not recommended in Android because they hold a reference to the enclosing class. However, in Java, the outer class is only GCed when the inner class is no longer referenced. That means, in Android, provided you have a non-static reference in the outer activity class to the inner class, the inner class cannot exist longer than the outer activity class because the activity can only be destroyed if it doesn't hold a reference to the inner class anymore (at least that is what I'm inferring). So what's the problem using non-static inner classes then (since they can't obviously exist longer than the outer activity if you infer from java)? Am I missing something?</p>

<p>Thanks!</p>
