This is all interesting learning as being able to iterate through views saves lots of code and makes the code more readable.
Your solution above will stop all of the buttons from making the click noise but if I try to limit the selection to the buttons that have the tag property set 1 through 16 I get a big red java error
It says:
java.lang.NumberFormatException: Invalid double: ""
I was playing about with this code:
For Each v As View In Activity.GetAllViewsRecursive
If v Is Button Then 'AND v.Tag > 0 AND v.Tag < 17 Then
Log(v.Tag)
Dim d As Double = v.Tag
If d > 0 AND d < 17 Then
Dim jo As JavaObject = v
jo.RunMethod("setSoundEffectsEnabled", Array As Object(False))
End If
End If
Next
as you can see I first tried with the line
If v Is Button AND v.Tag > 0 AND v.Tag < 17 Then
then I commented a bit of that out then I tried first putting the value of v.Tag into an Int and then into a Double but I still get the Java error.
If I don't try to limit the selection then it works fine