How to stop EditText from gaining focus at Activity startup in Android

后端 未结 30 2695
别那么骄傲
别那么骄傲 2020-11-21 06:40

I have an Activity in Android, with two elements:

  1. EditText
  2. ListView

When my Activity

30条回答
  •  死守一世寂寞
    2020-11-21 07:06

    The problem seems to come from a property that I can only see in the XML form of the layout.

    Make sure to remove this line at the end of the declaration within the EditText XML tags:

    
    

    That should give something like that :

    
    
       // /* <-- without this line */
    
    

提交回复
热议问题