Changed interaction dynamics in EditAlarmActivity

This commit is contained in:
Phillip Hsu
2016-06-05 23:24:22 -07:00
parent 7432a057b3
commit 3c3b9bf129
4 changed files with 77 additions and 17 deletions
@@ -0,0 +1,22 @@
package com.philliphsu.clock2.util;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
/**
* Created by Phillip Hsu on 6/5/2016.
*/
public class KeyboardUtils {
public static void hideKeyboard(Activity a) {
View view = a.getCurrentFocus();
if (view != null) {
InputMethodManager imm = (InputMethodManager)
a.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
}