'Handle the back key (see the example project for B4XPages implementation) Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event If KeyCode = KeyCodes.KEYCODE_BACK Then If prefdialog.BackKeyPressed Then Return True End If Return False End Sub 'Handle keyboard changes: Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int) prefdialog.KeyboardHeightChanged(NewHeight) End Sub Manifest editor: B4X: SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event If KeyCode = KeyCodes.KEYCODE_BACK Then If pnlAffichage.Visible = True Then If lstPersonnes.Size > 1 Then lstPersonnes.RemoveAt(lstPersonnes.Size - 1) Individu = lstPersonnes.Get(lstPersonnes.Size - 1) AfficherFiche(0) Else pnlAffichage.Visible = False lstPersonnes.Clear End If Return True Else openMsgBox Return True End If Else Return False End If End Sub