tags:

views:

55

answers:

1

Hi! I'm new to Android and just starting the very basics. I implement my custom button skin using .9.png images for norma/focus/pressed states. It works fine, but I noticed that after a pressed the focussed button it visually "lost" focus and draws the normal state frame. I planned to use different state images to highloght what button is selected right now, but it seems that it would not work. I noticed also that the same happens with the default LAF button. Is it OK, or it's just emulator issue? What the good workaroud can be used?

Thanks

A: 

This is the default behavior in touch mode, and you should not seek to tamper with it. This is how your users will expect for your app to behave. If you set the focus without touching the screen, such as when using the trackball that's available on most devices, it will indeed remain in focus, but in touch mode there's no visual representation for the state of having focus.

David Hedlund
Thanks for a quick response, David!But does it means the only way to "highlight" selected button is by doing it programatically?
Rilakkuma
I mean, if I have a menu at the botom part of the scren that allows me to start some activities I want thwe button still remains in "selected" mode indicating that this activity is "connected" with this button, something like toggle button...Thanks
Rilakkuma
@Rilakkuma: You could consider doing your own graphic not for the `Button`, but for the `ToggleButton` which is designed exactly for this: http://developer.android.com/intl/zh-CN/reference/android/widget/ToggleButton.html
David Hedlund
Thanks, David. I'll give it a try...
Rilakkuma