public class InputMethodUtil {
private static InputMethodUtil instance;
public static InputMethodUtil getInstance() {
if (instance == null)
instance = new InputMethodUtil();
return instance;
}
public void hideInputMethod(Context context, View view) {
((InputMethodManager) context.getSystemService(context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(view.getWindowToken(), 0);
}
public void showInputMethod(Context context, View view) {
((InputMethodManager) context.getSystemService(context.INPUT_METHOD_SERVICE)).showSoftInput(view, 0);
}
}