Back to project page welcome-android.
The source code is released under:
Copyright (c) 2014 FeedHenry Ltd, All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software")...
If you think the Android project welcome-android 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 com.feedhenry.android.utilities; //from w ww . ja v a 2 s.c om import android.content.Context; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; public class KeyboardToggle { public static void hideTheKeyboard(Context context, EditText editText){ InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editText.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN); } public static void showTheKeyboard(Context context, EditText editText){ InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT); } }