Hello everyone, I want to implement an automatic trigger button functions, such as two buttons, press one time, in onClickListener can write some code that will allow it to perform another button press action.
There are two buttons when pressed change the background image.
I used performclick () function, you can make the second button method performs onClickListener, but can not change the background image when the button is pressed.
Under How to achieve this, thank you! Below is achieved by pressing the button on my action
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
button2.setPressed (true); and button2.setPressed (false); were pressed and set the button2 original state.
You can start setPressed in onClickListener (true); in the last setPressed (false);
This can be achieved button2 clicks effect.
Reply:
Oh, thank you, I experimented a bit and found temporary Yes, my code is as follows:
button2.setPressed (true);
new Handler (). postDelayed (new Runnable () {
@ Override
public void run () {
/ / TODO Auto-generated method stub
button2.setPressed (false);
}
}, 50);
-------------------------------------------------- -------------
A more difficult no perfect way to do, such as sending a message to the second button ..... mapping out what the ......
Thank you!
Reply:
The landlord can look monkey-related information.

Reply:
Oh, thank you, well, read on, thank you!
No comments:
Post a Comment