Android Question reflector method affect other target

Discussion in 'Android Questions' started by le_toubib, Feb 25, 2015.

  1. le_toubib

    le_toubib Active Member Licensed User

    hello there
    the following code works fine on the specified target however , it s affects other views as well ???? (labels appear half painted, half transparent) even though nothing is public here
    what am i doing wrong?
    Sub showpreview
    ''''''''''''''''gets device size
       Dim s As String
    Dim f As Float
    Dim obj1 As Reflector

       obj1.Target = WebView1
       s = obj1.TypeName
       f = obj1.RunMethod(
    If GetDevicePhysicalSize > 6 Then    ' 7" or bigger tablet

    End If

    End Sub

    Sub GetDevicePhysicalSize As Float
    Dim lv As LayoutValues
        lv = 
    Return Sqrt(Power(lv.Height / lv.Scale / 1602) + Power(lv.Width / lv.Scale / 1602))
    End Sub
  2. Erel

    Erel Administrator Staff Member Licensed User

    Note that you can use GetDeviceLayoutValues.ApproximateScreenSize instead of this sub.

    I don't see how this code can affect other views unless you are referring to views inside the WebView.
  1. 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.
    Dismiss Notice