German Fehler beim Aktivieren der Tastatur

Lothar Kriegerow

Active Member
Hallo,

ich wollte beim Öffnen eines neuen Formulars den Focus in das Textfeld setzen und gleichzeitig die Tastatur aktivieren. Das Textfeld bekommt zwar den Cursor, aber die Tastatur poppt nicht auf.
Ich poste mal den Code. Sicher ist es ganz einfach, aber ich finde den Fehler nicht.


B4X:
#Region  Activity Attributes
    #FullScreen:  True
    #IncludeTitle:False
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim IME As IME2
    Private lblThema As Label
    Private PanEdit As Panel
    Private txtEdit As EditText
    Private txtErg As EditText
End Sub
Sub LayoutAktivieren
    Private X As Int
    Private cdw,cdw2 As ColorDrawable
    cdw.Initialize2(Colors.RGB(255,228,196), 12dip, 1dip, Colors.RGB(122,123,32))
    cdw2.Initialize2(Colors.RGB(255,228,196), 2dip, 1dip, Colors.RGB(122,123,32))
    txtErg.Background=cdw
    txtErg.Background =cdw2
    PanEdit.width=x
    X=100%x
    
End Sub
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("EditTopic")
    LayoutAktivieren
    IME.Initialize("IME2")
    IME.AddHandleActionEvent(txtEdit)
    IME.ShowKeyboard(txtEdit)
    txtEdit.RequestFocus
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Gruß Lothar
 

so27

Active Member
Licensed User
Longtime User
Setze folgenden Code in den Manifesteditor:
B4X:
SetActivityAttribute(Main, android:windowSoftInputMode, stateVisible)

MAIN ggf. durch "EditTopic" ersetzen.

 

Lothar Kriegerow

Active Member
Hallo,

dank - es funktioniert. Wie erlangt man dieses wissen? (Außer hier?)

Ich hab wie ein Weltmeister gegoogelt.

Gruß Lothar
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…