On Jan 20, 10:49 am, Burk Hufnagel <silveran...@gmail.com> wrote: > Tim, > > This is not an Android thing, it's a Java thing. Because the anonymous > instance of OnClickListener can exist after the onCreate method > completes its execution, you have to declare that builder is final > otherwise it will be cleaned up with any other local variables because > it's no longer in scope.
Actually the anonymous class object still has a reference to builder so it won't be "cleaned up" anyway. The final keyword has nothing to do with garbage collection. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en