This is a basic java question, not related to Android in any way... To do that you can create a constructor that takes as parameters the data you want you're listener to have access to. Alternatively you can add getters/setters to add that data you want separately. .. On Jun 29, 2012 1:21 PM, "StSch" <[email protected]> wrote:
> I have an Activity with a button and register an OnClickListener on this > button that is defined in a separate class file. Can I share data between > these 2 resources? That is: Can I access attributes/member variables from > my activity in my event listener? > > Regards, > -Steffen- > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

