Android:editable is deprecated:use a <EditText> to make it editable

Source: Internet
Author: User
Tags deprecated

problem: Android:editable is Deprecated:use A to make it editable Mean:Android's:Edit YesObjection:Use<</span> EditText > edit it
Analysis:About the read-only problem with the EditText control, that is, the content cannot be changed through the UI, but the content can be selected for replication. In the early SDK, EditText has the editable attribute, now this property has deprecated .  Workaround: In fact, just one line of code can be done Et.setkeylistener (null), note that this is not setonkeylistener, but Setkeylistener. This method is a member of the TextView, the effect after the call is fully expected, and the input method will not pop up after the focus is received .   the following is an explanation of the official document sets the key listener to being used with this TextView. This can is null to disallow user input. Note that this method had significant and subtle interactions with soft keyboards and other input Method:see KeyListener. getContentType () for important details. Calling this method would replace the current content type of the text view with the content type returned by the key Liste Ner. be warned that if you want a TextView with a key listener or movement method is not the focusable, or if you want A TextView without a key listener or movement method to being focusable, you must call Setfocusable again after calling this To get the focusability back the want it.
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.