[android-developers] Re: ImageButton and focus state...

2009-09-18 Thread sdphil
I wound up doing this in code -- ((ImageButton) findViewById (R.id.MyButton)).setOnFocusChangeListener(new OnFocusChangeListener() { public void onFocusChange(View view, boolean hasFocus) { view.setBackgroundResource(hasFocus ? R.drawable.focus_bg

[android-developers] Re: ImageButton and focus state...

2009-09-18 Thread Mark Murphy
sdphil wrote: > I want to change the android:background value when an image button is > selected (selected, not clicked). What's the easiest way to do that? Step #1: Find the existing StateListDrawable resource for ImageButton from the Android source code -- it should be an XML file Step #2: Co

[android-developers] Re: ImageButton and focus state...

2009-09-17 Thread ashok chakravarthy
create *item-selector* xml and keep that xml in drawable folder and finally use that as background of image button On Fri, Sep 18, 2009 at 7:13 AM, sdphil wrote: > > I want to change the android:background value when an image button is > selected (selected, not clicked). What's the easiest way