Set an OnClickListener on each button and update the state in the listener.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Jun 22, 2011 at 8:55 AM, [email protected] <[email protected]> wrote:

> by "didn't work" I mean that I still can click both of buttons
>
> On 22 июн, 17:52, Kostya Vasilyev <[email protected]> wrote:
> > I see.
> >
> > If by "didn't work" you mean that the visual state didn't change - you
> need
> > to use state-list drawables that include 'android:state_enabled="false"'
> >
> > http://developer.android.com/guide/topics/resources/drawable-resource...
> >
> > -- Kostya
> >
> > 2011/6/22 [email protected] <[email protected]>
> >
> >
> >
> >
> >
> >
> >
> > > I cann't use CheckBox, cause it'll be image inside my buttons.:(
> >
> > > On 22 июн, 17:39, Kostya Vasilyev <[email protected]> wrote:
> > > > Are the buttons actually check boxes?
> >
> > > > If so, use CheckBox methods:
> >
> > > > setOnCheckedChangeListener
> > > > isChecked
> > > > setChecked
> >
> > > >
> http://developer.android.com/reference/android/widget/CompoundButton....
> > > > )
> >
> > > > -- Kostya
> >
> > > > 2011/6/22 [email protected] <[email protected]>
> >
> > > > > I have 4 buttons (a1, a2, b1, b2). They can combinate: a1-b1;
> a1-b2;
> > > > > a2-b1; a2-b2.It means that "a1" and "a2" cann't be chosen together.
> So
> > > > > after clicking "a1" I need to block "a2".And depends on what 2
> buttons
> > > > > were pressed, it will be differenet actions.I tried something like
> > > > > this
> >
> > > > > if(a1.isPressed()){
> > > > >                        a2.setEnabled(false);
> > > > >                        a2.invalidate();}
> > > > >                        else if (b1.isPressed()){
> > > > >                        b2.setEnabled(false);
> > > > >                        b2.invalidate();}
> >
> > > > > but it didn't work.Does anyone have an idea how I can do it? Thank
> you
> > > > > in advance!
> >
> > > > > --
> > > > > 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
> >
> > > --
> > > 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
>
> --
> 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
>

-- 
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

Reply via email to