Android Dynamic Display and hiding of soft keyboards and android dynamic
* ** Dynamically display and hide a floppy disk * @ author JPH */public class MainActivity extends Activity implements OnClickListener {private InputMethodManager inputMethodManager; private Timer timer; private EditText edit; @ Override protected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); edit = (EditText) findViewById (R. id. edit); inputMethodManager = (InputMethodManager) getSystemService (Context. INPUT_METHOD_SERVICE); timer = new Timer (); timer. schedule (new TimerTask () {@ Override public void run () {inputMethodManager. toggleSoftInput (0, InputMethodManager. HIDE_NOT_ALWAYS); }}, 1000) ;}@ Overridepublic void onClick (View v) {// TODO Auto-generated method stubswitch (v. getId () {case R. id. btnShow: // display the floppy disk inputMethodManager. toggleSoftInput (0, InputMethodManager. HIDE_NOT_ALWAYS); break; case R. id. btnHide: // hide the floppy disk inputMethodManager. hideSoftInputFromWindow (edit. getWindowToken (), InputMethodManager. HIDE_NOT_ALWAYS); break; default: break ;}}}