Partager via


InputMethodManager.ShowSoftInput Method

Definition

Overloads

ShowSoftInput(View, ShowFlags)

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.

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)

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.

[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

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.

Java documentation for android.view.inputmethod.InputMethodManager.showSoftInput(android.view.View, int).

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

If non-null, this will be called by the IME when it has processed your request to tell you what it has done. The result code you receive may be either #RESULT_UNCHANGED_SHOWN, #RESULT_UNCHANGED_HIDDEN, #RESULT_SHOWN, or #RESULT_HIDDEN.

Returns

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.

<strong>Caveat:</strong> 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.

Java documentation for android.view.inputmethod.InputMethodManager.showSoftInput(android.view.View, int, android.os.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.

Applies to