Discussion:
I Want to show and dismiss the keyboard on edit Text ??
(too old to reply)
Sana Rajput
2018-09-14 07:21:15 UTC
Permalink
I have showed Numeric keyboard on edit Text by using the following code,

InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
imm.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.NotAlways);

now if i press the Home button of the device it still show me the keyboard,
Please help me out to resolve this issue
Thanks in advance.
a***@gmail.com
2018-09-18 06:09:02 UTC
Permalink
Post by Sana Rajput
I have showed Numeric keyboard on edit Text by using the following code,
InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
imm.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.NotAlways);
now if i press the Home button of the device it still show me the keyboard,
Please help me out to resolve this issue
Thanks in advance.
Hi Sana, I got the solution, use following code in onPause(),

InputMethodManager inputManager = (InputMethodManager)GetSystemService(Context.InputMethodService);
var currentFocus = this.CurrentFocus;
if (currentFocus != null)
{
inputManager.HideSoftInputFromWindow(currentFocus.WindowToken, HideSoftInputFlags.None);
}

--
If you still need help regarding Xamarin Development(https://www.raybiztech.com/mobile/xamarin-mobile-apps) feel free to contact me.
Loading...