How to change image on focus and unfocus

by Raj » Mon, 23 Jun 2008 16:47:55 GMT


Sponsored Links
 How to chanage the image on focus and unfocus
--~--~---------~--~----~------------~-------~--~----~



How to change image on focus and unfocus

by Josh Guilfoyle » Wed, 25 Jun 2008 02:57:16 GMT


 Use a selector drawable as such:

res/drawable/foo.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android=" http://schemas.android.com/apk/res/android" ;>
    <item
        android:drawable="@drawable/foo_focused"
        android:state_focused="true" />
    <item
        android:drawable="@drawable/foo_not_focused" />
</selector>

Then simply use the foo drawable as your image or widget background.




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Can't find the Emulator Settings

Looking around the debugging methods, I love the emulator.

http://code.google.com/android/intro/develop-and-debug.html#additionaldebugging
gives very good debugging options for developers to handle Goldfish.
But I can't find the exact options within emulator help, DDMS+Eclipse
menus and even ADB help.

Can anyone give a favor to lead me to set Goldfish like the above URL?

--~--~---------~--~----~------------~-------~--~----~

2. "Cannot finish download. There is not enough space."

I'm trying to set up my IIS server to serve out my APK for anyone who
wants to download it directly from my site.  I added the .apk
extension and mime type to my site which changed the error I was
getting in the android's browser from not compatible with the device,
to not enough space on the device.  However it's showing that I have
more than enough space (the apk is only 9KB and device shows over 48MB
available).  I'm guessing there's some other kind of configuration
error going on with this.  Has anyone seen this issue before?
--~--~---------~--~----~------------~-------~--~----~

3. Get downloads at GetJar

4. Programatically Changing Default Name of Bluetooth Device "Without Activating the Device Itself"

5. How to query for my current location?

6. detect earphone

7. Android Developer Challenge II question