In my android application it automatically focuses the first Button I have in my layout, giving it an orange outline. How can I set the initial focus preferably in XML, and can this be set to nothing?
+4
A:
You could use the requestFocus
tag:
<Button ...>
<requestFocus />
</Button>
I find it odd though that it auto-focuses one of your buttons, I haven't observed that behavior in any of my views.
Matthias
2010-04-30 10:33:58
Yeah, it has happened with two of my applications now. I guess I could requestFocus onto a element that doesn't change like a TextView or would this not be allowed?
stealthcopter
2010-04-30 10:58:44
I believe it will work on any view that is focusable.
Matthias
2010-04-30 15:49:12