Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

TextInputEditText in android popup window not getting focus

i have a spinner and 2 TextInputEditText inside a linear layout.

inside a fragment i added this layout to the popup window. for spinner i added a custom adapter with image and text. the TextInputEditText are not getting focus, i tried all the possible ways.

tried with some possible conditions

and also tried getting the keypad to focus with TextInputEditText click event, with this able to open the keypad but the TextInputEditText is not getting the focus.

View objPopupview = LayoutInflater.From(ViewGroup.Context).Inflate(Resource.Layout.AddAccountTabPage, null);
            m_PopupWindow = new PopupWindow(objPopupview, LayoutParams.WrapContent, LayoutParams.WrapContent, true);
            m_PopupWindow.Focusable = true;
             m_PopupWindow.SoftInputMode = SoftInput.StateVisible;
            m_PopupWindow.OutsideTouchable=(true);
            m_PopupWindow.Touchable=(true);
            m_PopupWindow.Update();

 txtUserNameEditBox.Click += delegate
                {
                    txtUserNameEditBox.RequestFocus();
                    txtUserName.RequestFocus();
                    txtUserName.FocusableInTouchMode = true;
                    InputMethodManager imm = (InputMethodManager)ViewGroup.Context.GetSystemService(Context.InputMethodService);
                    imm.ShowSoftInput(txtUserName, ShowFlags.Forced);
                    imm.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.ImplicitOnly);
                };

Answers

Sign In or Register to comment.