Hi,
The following color change example works well on lower versions of Android because "android.graphics.drawable.drawable" is an abstract class and is based on a private API which in higher versions of Android throws an error: noSuchMethodException.
I am looking for a working code for android version 12, could someone help me, thank you very much in advance.
The following color change example works well on lower versions of Android because "android.graphics.drawable.drawable" is an abstract class and is based on a private API which in higher versions of Android throws an error: noSuchMethodException.
I am looking for a working code for android version 12, could someone help me, thank you very much in advance.
'noSuchMethodException: >= SDK30:
Public Sub SetScrollbarColor(sv As ScrollView, clr As Int)
Dim r As Reflector
r.Target = sv
r.Target = r.GetField("mScrollCache")
r.Target = r.GetField("scrollBar")
Dim cd As ColorDrawable
cd.Initialize(clr, 5dip)
r.RunMethod4("setVerticalThumbDrawable", Array(cd), Array As String("android.graphics.drawable.Drawable"))
End Sub