public final class ScreenUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
hideSoftKeyboard(android.app.Activity activity)
Hides soft keyboard from the current window.
|
static boolean |
hideSoftKeyboard(android.view.View focusedView)
Hides soft keyboard from the current window using token of the given focused view.
|
static boolean |
showSoftKeyboard(android.app.Activity activity)
Shows soft keyboard on the current window.
|
static boolean |
showSoftKeyboard(android.view.View focusedView)
Shows soft keyboard on the current window using token of the given focused view.
|
public static boolean hideSoftKeyboard(android.app.Activity activity)
Note, that this will not work when you want to hide soft keyboard while a dialog is
visible, use hideSoftKeyboard(View) instead.
activity - Current activity context to obtain the current focused view.True if hiding was successful, false if a window of the given
activity does not have focused view at this time.public static boolean hideSoftKeyboard(android.view.View focusedView)
focusedView - The view which has focus at this time.True if hiding was successful, false if the view does not
have focus at this time.public static boolean showSoftKeyboard(android.app.Activity activity)
Note, that this will not work when you want to show soft keyboard while a dialog is
visible, use showSoftKeyboard(View) instead.
activity - Current activity context to obtain the current focused view.True if showing was successful, false otherwise.public static boolean showSoftKeyboard(android.view.View focusedView)
focusedView - The view which has focus at this time. If the view does not have focus,
focus for that view will be requested by View.requestFocus().True if showing was successful, false otherwise.