I need to keep a button pressed until the method end, because the user not can press again while the button stays pressed.
I tryed this:
on create:
Button btnSend= (Button) findViewById(R.id.btnSend);
btnSend.setOnClickListener(onClickbtnSend);
Method:
Button.OnClickListener onClickbtnSend= new Button.OnClickListener() {
@Override
public void onClick(View v){
try{
v.setPressed(true);
//do something ......
} catch(Exception e){
e.printStackTrace();
}
v.setPressed(false);
}
Somebody have idea? Thanks
You may want to use a ToggleButton instead since your button seems to have two states (busy or not).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With