Android show softkeyboard with showSoftInput is not working?

后端 未结 12 1988
抹茶落季
抹茶落季 2020-12-28 13:49

I have created a trivial application to test the following functionality. When my activity launches, it needs to be launched with the softkeyboard open.

My code doe

12条回答
  •  时光说笑
    2020-12-28 14:11

    Solution for Xamarin developers (_digit1 == EditText):

            var focussed = _digit1.RequestFocus();
            if (focussed)
            {
                Window.SetSoftInputMode(SoftInput.StateAlwaysVisible);
                var imm = (InputMethodManager)GetSystemService(InputMethodService);
                imm.ToggleSoftInput(ShowFlags.Forced, 0);
            }
    

提交回复
热议问题