Android Question 1 of many EditTexts are "pre-selected" everytime layout loads

pcbtmr

Member
Licensed User
Longtime User
I have a layout with multiple EditTexts for numeric entry. One particular field is always pre-selected and always triggers HasFocus when the layout loads. I am at a loss as to what property to set to disable this.
Thanks.
 

Cableguy

Expert
Licensed User
Longtime User
EditTexts tend to do that if you have no other type of views that have a "Focus" property, like buttons. a way to avoid the stealing of the focus is to add a "not really needed" textview, set it to visible=false, and set the focus to it
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
apparently, he doesn't want any to have initial focus
 
Upvote 0

pcbtmr

Member
Licensed User
Longtime User
Correct. The problematic edittext is not the first in the series and when the layout loads, that HasFocus event triggers the associated toastmessage. If it was the first in the series it would not be as big of a deal but, moving the problematic ET out of the arrangement, and making it invisible but enabled worked.
 
Upvote 0
Top