Back to project page downtown.
The source code is released under:
GNU General Public License
If you think the Android project downtown listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.dklisiaris.downtown.helper; // w w w.j a va 2s .c o m import android.app.Activity; import android.content.Context; import android.util.Log; import android.view.inputmethod.InputMethodManager; public class KeyboardUtil { public static void hideKeyboard(Activity activity) { try { InputMethodManager inputManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } catch (Exception e) { // Ignore exceptions if any Log.e("KeyBoardUtil", e.toString(), e); } } }