Android Auto Eject soft keyboard (input keyboard)

Source: Internet
Author: User

Searcheditview.setfocusable (true); Searcheditview.setfocusableintouchmode (true);        Searcheditview.requestfocus (); Timer Timer=NewTimer (); Timer.schedule (NewTimerTask () { Public voidrun () {Inputmethodmanager InputManager=(Inputmethodmanager) Searcheditview.getcontext (). Getsystemservice (Context.input                               _method_service); Inputmanager.showsoftinput (Searcheditview,0); }                       },                998);

The first step is to request focus on the specified input box. Then call the input manager to eject the soft keyboard.

Warning: If you just jump to a new interface to eject the soft keyboard, the above code may not eject the soft keyboard because the interface is loaded completely. A soft keyboard such as 998 milliseconds (which ensures that the interface's data is loaded) should be properly delayed.

Android Auto Eject soft keyboard (input keyboard)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.