Android Question Show/Hide Cursor Drag thingy programatically [SOLVED]

Discussion in 'Android Questions' started by Roger Daley, Apr 9, 2016.

  1. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Hi All,

    I am not sure of the correct name but in the image attached the "cursor drag thing" is shown. I need to show/hide this proramatically but can'r find any reference to it in my searches. This may be because I have not used the correct term.

    Any help appreciated.

    Regards Roger

    Cursor.jpg
     
  2. mangojack

    mangojack Well-Known Member Licensed User

    Roger Daley likes this.
  3. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Hi mangojack,

    That certainly looks like what I need but I have no idea how to implement that in B4A.
    I will keep searching using terminology used in the Stackoverflow post.

    Regards Roger
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    This is the code:
    Code:
    Sub ShowPins (et As EditText, Show As Boolean)
       
    Dim r As Reflector
       r.Target = et
       r.Target = r.GetField(
    "mEditor")
       r.Target = r.RunMethod(
    "getSelectionController")
       
    If r.Target <> Null Then
         
    If Show Then
           r.RunMethod(
    "show")
         
    Else
           r.RunMethod(
    "hide")
         
    End If
       
    End If
    End Sub
    It is based on private APIs.
     
    Roger Daley likes this.
  5. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Thanks Erel,

    It works brilliantly of course.

    Regards Roger
     
Loading...
  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