Solution: android: editable is deprecated: Use an & lt; EditText & gt; to make it editable

Source: Internet
Author: User

Solution: android: editable is deprecated: Use an <EditText> to make it editable
Question: android: editable is deprecated: Use an to make it editable meaning: Android: editing is against: Use </span> EditText> to edit and analyze it: for the read-only problem of the EditText control, that is, the content in the EditText control cannot be changed through the UI, but some content can be selected for copying. in earlier sdks, EditText had the Editable attribute, which is now deprecated. solution: in fact, you only need a line of code to get et. setKeyListener (null); note that this parameter is not setOnKeyListener, but setKeyListener. this method is a member of TextView. the result after the call is exactly as expected, and the input method is not displayed after the focus is obtained. the following is an explanation of the official document Sets the key listener to be used with this TextView. this can be null to disallow user input. note that this method has significant and subtle interactions with soft keyboards and other input method: see KeyListener. getContentType () for important details. calling this method will replace the current content type of the text view with the content type returned by the key listener. be warned that if you want a TextView with a key listener or movement method not to be focusable, or if you want a TextView without a key listener or movement method to be focusable, you must call setFocusable again after calling this to get the focusability back the way you 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.