Is there a way to find the type and name of a views parent? I'm using a couple CustomListViews in several tabs along with CLVSelections. When a user hits a button I can get the button info from Sender, but I'd like to be able to walk up and down the parent tree to find who hit it on which panel. Is there some straightforward way of doing this, probably using the .parent method?
For Each v As View In Activity.GetAllViewsRecursive
If v Is CheckBox Then '<----- change Checkbox for the type of view you need
SetButtonTintList(v, Colors.Red, Colors.Blue)
End If
Next
1. Add: #AdditionalJar: com.android.support:support-compat 2: Sub SetButtonTintList(View As View, Disabled As Int, Enabled As Int) Dim States(2,1) As Int Dim sd As StateListDrawable 'ignore States(0, 0) = sd.State_Enabled States(1, 0) = sd.State_Disabled Dim Color(2) As Int =...
www.b4x.com
You can change the Activity.GetAllViewsRecursive for the parent of your views.
I.e, if you have your views in a panel you can check with panel.GetAllViewsRecursive or if you have a button inside a panel, button.parent.GetAllViewsRecursive