Android Question Android 9 B4XLoadingIndicator

Almora

Active Member
Licensed User
Longtime User
hi..
I'm using video viewing.
error occurs when I rotate the screen in android 9.
works well on android 6, 7, 8.

I'm using this code to rotate the screen.
B4X:
........

Sub vv_Prepared
 
    Label1.Visible=False

    For Each v As View In Activity.GetAllViewsRecursive
        If v.Tag Is B4XLoadingIndicator And v.Visible = True Then
            Dim x As B4XLoadingIndicator = v.Tag
            x.Hide
        End If
    Next
 
End Sub


Sub VV_Error(what As Int, iextra As Int)
    Msgbox("error","")
    For Each v As View In Activity.GetAllViewsRecursive
        If v.Tag Is B4XLoadingIndicator And v.Visible = True Then
            Dim x As B4XLoadingIndicator = v.Tag
            x.Hide
        End If
    Next
    Label1.Visible=False
    vv.Pause
'    Activity.Finish
'    StartActivity(page2)
End Sub


Sub Button1_Click
   p.SetScreenOrientation(0)
End Sub

.........

error
Error occurred on line: 34 (B4XLoadingIndicator)
java.lang.RuntimeException: java.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
........
....
..
.

line: 34 (B4XLoadingIndicator)
B4X:
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
    mBase = Base
    mBase.Tag = Me
      clr = xui.PaintOrColorToColor(Props.Get("Color"))
    Dim style As String= Props.Get("IndicatorStyle")
    Dim duration As Int = Props.Get("Duration")
    DrawingSubName = "Draw_" & style.Replace(" ", "")
    cvs.Initialize(mBase)
    MainLoop
End Sub  ' line 34


when target sdk 28 is set..
This error occurs only on android 9 devices. How can I fix?
thanks..
 
Last edited:
Top