Learn Python


Click to Learn Python3

Monday, November 7, 2011

Show or Hide soft keyboard on opening a dialog or activity in android

For showing the soft keyboard on entering into the activity or to the dialog we can use this coding


Java


InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);



and for hiding the keyboard



Java

InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0);



Have a nice day!

18 comments:

  1. I hope you have a nice day! Very good article, well written and very thought out. I am looking forward to reading more of your posts in the future.teddy bears for babies

    ReplyDelete
  2. Well, I have used the same code but still I am unable to fire the event. I have called that statements on button click event.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. Extratorrent

    ReplyDelete
  5. The blog are the best that is extremely useful to keep.
    I can share the ideas of the future as this is really what I was looking for,
    I am very comfortable and pleased to come here. Thank you very much!
    Free Source Code
    Free Source code For Academic
    Academic Project Download
    Academic Project Free Download
    Freelancer In India

    ReplyDelete
  6. Free Source Code
    This will mainly be used by distance education programs offered by institutes, inorder to enable students to get the academic facilities from any computer connected to the Internet. If you want to read more :- Free Source Code|Free Sourcecode For Academic|Academic Project Download|Academic Project Free Download|Freelancer In India. E-mail :- info@nikhilbhalerao.com ph. no. +91 9423979339 https://nikhilbhalerao.com/. #Academic_Project_Download #Academic_Project_Free_Download

    ReplyDelete
  7. Simply want to say your article is as astonishing. The clearness in your post is just nice and i can assume you are an expert on this subject. Fine with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please keep up the enjoyable work.apple support berlin

    ReplyDelete
  8. Very enthusiastic article, add so much useful information to me.essay rewriter birmingham

    ReplyDelete