diff options
Diffstat (limited to 'src/com/android/dialer/util/DialerUtils.java')
-rw-r--r-- | src/com/android/dialer/util/DialerUtils.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/dialer/util/DialerUtils.java b/src/com/android/dialer/util/DialerUtils.java index 07a330e6c..bd1813354 100644 --- a/src/com/android/dialer/util/DialerUtils.java +++ b/src/com/android/dialer/util/DialerUtils.java @@ -26,6 +26,7 @@ import android.net.Uri; import android.provider.Telephony; import android.text.TextUtils; import android.view.View; +import android.view.inputmethod.InputMethodManager; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; @@ -147,4 +148,20 @@ public class DialerUtils { return TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL; } + + public static void showInputMethod(View view) { + final InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService( + Context.INPUT_METHOD_SERVICE); + if (imm != null) { + imm.showSoftInput(view, 0); + } + } + + public static void hideInputMethod(View view) { + final InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService( + Context.INPUT_METHOD_SERVICE); + if (imm != null) { + imm.hideSoftInputFromWindow(view.getWindowToken(), 0); + } + } } |