Android EditText not pop-up input Method Focus issue Summary

Source: Internet
Author: User

Transferred from: http://mobile.51cto.com/aprogram-403138.htm

See a manifest in the activity configuration, if this page has edittext, and we want to enter this page by default pop-up input method, you can set this property: Android:windowsoftinputmode= Statevisible, this will be the default pop-up input method, of course, there are other ways.

 1  <  activity  android:name  = ". Ui.login"  2   android:configchanges  = "Orientation|keyboardhidden|locale"  3   Android:screenorientation  = "Portrait"  4   Android:windowsoftinputmode  Span style= "color: #0000ff;" >= "Statevisible|adjustpan"  >  5  </ activity  >  

Android EditText Not Popup Input Method summary

Method One:

Which activity to select in Androidmainfest.xml, set Windowsoftinputmode property to Adjustunspecified|statehidden

For example:

1 <ActivityAndroid:name=". Main " 2 Android:label= "@string/app_name" 3 Android:windowsoftinputmode= "Adjustunspecified|statehidden" 4 android:configchanges= "Orientation|keyboardhidden"> 5 <Intent-filter> 6 <ActionAndroid:name= "Android.intent.action.MAIN" /> 7 <categoryAndroid:name= "Android.intent.category.LAUNCHER" /> 8 </intent-filter> 9 </activity>

Method Two:

Let EditText lose focus, use EditText's Clearfocus method

For example:

1 EditText edit=2

Method Three:

Force Hide Android IME window

For example:

123 Imm.hidesoftinputfromwindow (Edit.getwindowtoken (), 0);  

2.EditText always does not eject the software keyboard

Cases:

1 EditText edit=2 edit.setinputtype (inputtype.type_null);  

Android EditText not pop-up input Method Focus issue Summary

Related Article

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.