I tried your code on a simple activity, with a handful of widgets organized with a LineraLayout and it doesn't work. The virtual keyboard shows up all the time, takes over half the screen, and refuses to go away. What on earth can I be doing wrong?
Thanks, Eyal On Oct 2, 8:07 pm, Prajakta Shitole <[email protected]> wrote: > Hi, > > You can try the below code and see if it works: > > getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_AL > WAYS_HIDDEN); > > this would be at the window where you want to hide the keyborad. > or > > I had used the below piece of code in the onClick event of a button (*Butto*n > is my button) > > InputMethodManager imm = > (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); > imm.hideSoftInputFromWindow(*Button*.getWindowToken(), 0); > > I have not used any thing else..just changed some design a bit in order to > serve my purpose. > > Thanks, > Prajakta > > > > On Sat, Oct 2, 2010 at 11:01 AM, EvgenyV <[email protected]> wrote: > > Hi Prajakta, > > > I have the similar issue when on my class is ListActivity and layout > > has TextView as topmost element and the following is the list. > > If I'm putting the list as top element and TextView as second the soft > > keyboard is not appeared. > > > Did you find some way to hide soft keyboard? > > > Thanks in advance, > > Evgeny > > > On Apr 18, 4:57 am, praj <[email protected]> wrote: > > > Hi, > > > > I was trying to disable the keyboard on my ListActivity but it does > > > not work, however the same code works in a normal activity. Is there > > > anything that i am missing. > > > > I have tried the following : > > > 1) > > > getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_AL > > WAYS_HIDDEN); > > > > 2) EditText search_s = (EditText) findViewById(R.id.search_txt); > > > InputMethodManager imm = > > > (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); > > > imm.hideSoftInputFromWindow(search_s.getWindowToken(), 0); > > > > Is there anything that I need to do if it is a ListActivity or is it > > > the same? > > > > Please can anyone let me know about this. > > > > Thanks, > > > Prajakta > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected]<android-developers%2Bunsubs > > > [email protected]> > > > For more options, visit this group athttp:// > > groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

