InputMethodManager.ShowSoftInput Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| ShowSoftInput(View, ShowFlags) |
Explicitly request that the current input method's soft input area be shown to the user, if needed. |
| ShowSoftInput(View, ShowFlags, ResultReceiver) |
Explicitly request that the current input method's soft input area be shown to the user, if needed. |
ShowSoftInput(View, ShowFlags)
Explicitly request that the current input method's soft input area be shown to the user, if needed.
[Android.Runtime.Register("showSoftInput", "(Landroid/view/View;I)Z", "")]
public bool ShowSoftInput(Android.Views.View? view, Android.Views.InputMethods.ShowFlags flags);
[<Android.Runtime.Register("showSoftInput", "(Landroid/view/View;I)Z", "")>]
member this.ShowSoftInput : Android.Views.View * Android.Views.InputMethods.ShowFlags -> bool
Parameters
- view
- View
The currently focused view, which would like to receive soft keyboard input.
Note that this view is only considered focused here if both it itself has
View#isFocused view focus, and its containing window has
View#hasWindowFocus window focus. Otherwise the call fails and
returns false.
- flags
- ShowFlags
Provides additional operating flags. Currently may be
0 or have the #SHOW_IMPLICIT bit set.
Returns
A status value for the request. A true value does not guarantee that the request
was delivered or that the input method is shown. To check visibility, use
android.view.WindowInsetsController#show instead and set a
View.OnApplyWindowInsetsListener and verify the provided WindowInsets for
the visibility of IME.
- Attributes
Remarks
Synonym for #showSoftInput(View, int, ResultReceiver) without a result receiver: explicitly request that the current input method's soft input area be shown to the user, if needed.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ShowSoftInput(View, ShowFlags, ResultReceiver)
Explicitly request that the current input method's soft input area be shown to the user, if needed.
[Android.Runtime.Register("showSoftInput", "(Landroid/view/View;ILandroid/os/ResultReceiver;)Z", "")]
public bool ShowSoftInput(Android.Views.View? view, Android.Views.InputMethods.ShowFlags flags, Android.OS.ResultReceiver? resultReceiver);
[<Android.Runtime.Register("showSoftInput", "(Landroid/view/View;ILandroid/os/ResultReceiver;)Z", "")>]
member this.ShowSoftInput : Android.Views.View * Android.Views.InputMethods.ShowFlags * Android.OS.ResultReceiver -> bool
Parameters
- view
- View
The currently focused view, which would like to receive soft keyboard input.
Note that this view is only considered focused here if both it itself has
View#isFocused view focus, and its containing window has
View#hasWindowFocus window focus. Otherwise the call fails and
returns false.
- flags
- ShowFlags
Provides additional operating flags. Currently may be
0 or have the #SHOW_IMPLICIT bit set.
- resultReceiver
- ResultReceiver
An optional receiver for a result code. The receiver
is not a reliable way to determine whether the input method is shown or hidden.
The result code may be either #RESULT_UNCHANGED_SHOWN,
#RESULT_UNCHANGED_HIDDEN, #RESULT_SHOWN, or
#RESULT_HIDDEN.
Returns
A status value for the request. A true value does not guarantee that the request
was delivered or that the input method is shown. The result receiver is not a
reliable way to determine whether the input method is shown or hidden.
- Attributes
Remarks
Explicitly request that the current input method's soft input area be shown to the user, if needed. Call this if the user interacts with your view in such a way that they have expressed they would like to start performing input into it.
Caveat: ResultReceiver instance passed to this method can be a long-lived object, because it may not be garbage-collected until all the corresponding ResultReceiver objects transferred to different processes get garbage-collected. Follow the general patterns to avoid memory leaks in Android. Consider to use java.lang.ref.WeakReference so that application logic objects such as android.app.Activity and Context can be garbage collected regardless of the lifetime of ResultReceiver.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.