Android Work Problem Solving record

Source: Internet
Author: User

First, the focus problem of EditText

Problem Description: When the page contains only two edittext, want to hide the input method, and remove the edittext focus (only to remove focus, because you need to listen to focus changes to do some of the action), but because the interface of the focus can not be removed, After each clearfocus, the system will re-find a control that can focus from the interface, and then the first edittext will always onfocus again to get to the focus.

Workaround:

Add the following to the layout of edittext so that layout can get foucus, and you can get focus before the child controls, and at the same time, the layout calls Requestfocus at Clearfocus. The focus is shifted from edittext to layout, which solves the problem of the EditText control gaining focus. Reference: Http://stackoverflow.com/questions/14424654/how-to-clear-focus-for-edittext

Android:descendantfocusability= "Beforedescendants"
Android:focusableintouchmode= "true"

Android Work Problem Solving record

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.