I need to get the actual name of the view that is the Sender when using the send=sender syntax. I can't store it in Tag because I'm storing other info there.
MyView's Tag is being used solely to store a single value.
Instead create and initialize a Map, assign it as MyView's Tag object:
B4X:
Dim TagValues As Map
TagValues.Initialize
TagValues.Put("OriginalValue", "A string")
TagValues.Put("ViewName", "My view name")
TagValues.Put("YetAnotherValue", 123.45)
MyView.Tag=TagValues
That way you can use the Tag's Map object to store as many individual values as you need.
I have had to use custom types as my main informational storage devices and throwing them additionally into views just adds to the complexity and confusion.
However it is needed in B4A and I respect why is is a commonly implemented process to accomplish the required tasks..
I appreciate the idea of adding a map as the "type" of your custom type. I think that was a great Idea.
Pass some complex types with sub types around for a bit though and it becomes QUITE painful. Is B4A getting classes soon ?
Maps are kind of like Named arrays. Similar to how arrays in PHP are. Strings are never very efficient though, and maps use them for the index and the value (assuming you are also storing strings), so you get twice the hit. Might be better off using a Type.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.