Re: [android-developers] button onClick handler retrieve custom attribute value declared in activity_main.xml

2016-08-08 Thread Steve Gabrilowitz
You might also want to create your buttons with a loop in your code instead of in the layout file On Aug 8, 2016 5:41 AM, "Thomas Fazekas" wrote: > My bad... thanks for setting me straight. > > On Sunday, August 7, 2016 at 5:18:52 PM UTC+2, Steve Gabrilowitz wrote: >>

Re: [android-developers] button onClick handler retrieve custom attribute value declared in activity_main.xml

2016-08-08 Thread Thomas Fazekas
My bad... thanks for setting me straight. On Sunday, August 7, 2016 at 5:18:52 PM UTC+2, Steve Gabrilowitz wrote: > > toString() returns a string representation of an object which is not > necessarily the value of the object. your view.getTag() returns an object > which is already a String so

Re: [android-developers] button onClick handler retrieve custom attribute value declared in activity_main.xml

2016-08-07 Thread Steve Gabrilowitz
toString() returns a string representation of an object which is not necessarily the value of the object. your view.getTag() returns an object which is already a String so all you have to do is cast it to string rather than using toString() on it String buttStr = (String) view.getTag(); is what

[android-developers] button onClick handler retrieve custom attribute value declared in activity_main.xml

2016-08-07 Thread Thomas Fazekas
Dear all, here is what I want to do : declare a whole bunch of buttons in the activity_main.xml each of them having one custom tag (in this case it's called "tag"). All the buttons would share the same onClick handler, where I would use this custom property value to construct some strings (a

[android-developers] button onClick handler retrieve custom attribute value declared in activity_main.xml

2016-08-07 Thread Thomas Fazekas
Dear all, here is what I want to do : declare a whole bunch of buttons in the activity_main.xml each of them having one custom tag (in this case it's called "tag"). All the buttons would share the same onClick handler, where I would use this custom property value to construct some strings (a