Android Question IME library error

uniplan

Active Member
Licensed User
Longtime User
I have tried to use IME library but when I add the statement:

B4X:
IME.AddHeightChangedEvent

I have this error:

 

uniplan

Active Member
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
   


    'Initialize the NavDrawer object. This modifies the internal Layout structure of your Activity
    'and adds the Navigationdrawer.
    'Attention: THIS HAS TO BE DONE BEFORE LOADING A LAYOUT TO THE ACTIVITY!
    NavDrawer.Initialize2("NavDrawer", Activity, NavDrawer.DefaultDrawerWidth, NavDrawer.GRAVITY_START)
    Activity.LoadLayout("frmMainAutista")

    creazione_action_bar_e_menu

    If FirstTime=True Then
        rsz.rszMAP.Initialize
        rsz.setta_scala(Activity)
        cnb.Initialize(Colors.LightGray,5)
        'spnAutomezzi.Background=cnb
        acspnAutomezzi.Background=cnb
        'spnAutomezzi.DropdownBackgroundColor=cnb
        'pgWheel1.Initialize("pgw")
        bg.Initialize(1000)
        timer_beacon.Initialize("timerBeacon",1000)
        timer_nota_vocale.Initialize("timer_nota_vocale",1000)
        timer_nota_vocaleODS.Initialize("timer_nota_vocaleODS",1000)
        avs.Initialize
        ods_attivo.Initialize
        man_str_attiva.Initialize
       
        imageFolder = Starter.rp.GetSafeDirDefaultExternal("")
        spmMANcatMap.Initialize
        lstViewMANelencoMAP.Initialize
        audioGest.Initialize("frmMainAutista","audioGest_esito")
        audioGestODS.Initialize("frmMainAutista","audioGestODS_esito")
       
        IME1.Initialize("IME1")
        IME1.AddHeightChangedEvent

    End If
   
    ridimensiona
   
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Here is the solution:

Add this sub:
B4X:
Sub InitializeNavDrawerAndIME
   ime.Initialize("ime")
   ime.AddHeightChangedEvent
   Dim e As Panel = Activity.Parent
   e.RemoveAllViews
   Dim p As Panel = e.Parent
   p.RemoveAllViews
   p.AddView(Activity, 0, 0, 100%x, 100%y)
   'Initialize the NavDrawer object. This modifies the internal Layout structure of your Activity
   'and adds the Navigationdrawer.
   'Attention: THIS HAS TO BE DONE BEFORE LOADING A LAYOUT TO THE ACTIVITY!
   NavDrawer.Initialize2("NavDrawer", Activity, NavDrawer.DefaultDrawerWidth, NavDrawer.GRAVITY_START)
   p = Activity.Parent
   Dim p2 As Panel = p.Parent
   p.RemoveView
   p2.AddView(e, 0, 0, 100%x, 100%y)
   e.AddView(p, 0, 0, 100%x, 100%y)
End Sub

Call InitializeNavDrawerAndIME instead of the call to NavDrawer.Initialize2.
 
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
I try it.
I haven't error, but ime_HeightChanged event don't rised when keyboard show.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…