I want to have the background of an AutoCompleteTextView change
whenever the focus switches to the view. Seems easy enough, but after
overriding the onFocusChange method, I've noticed the focus switches
every time I call setBackgroundResource. To clarify, this code
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
v.setBackgroundResource(0);
} else {
v.setBackgroundResource(R.drawable.search_inactive);
}
}
}
results in onFocusChange getting called twice, with hasFocus switching
values on each call, such that if the view is not focused, tapping it
will result in the calls:
onFocusChange(view, true)
onFocusChange(view, false)
Is this expected behavior?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en