Possible Duplicate:
Android. How do I keep a button displayed as PRESSED until the action created by that button is finished?
I have a button, and I want that when I press it, it stays as pressed (with the green color on Froyo).
Any help?
mycodes_Button = (Button) findViewById(R.id.mycodes);
...
if (saved_Button.isPressed())
{
saved_Button.setFocusable(true);
}
Something like this?
Use the following code. It's useful.
mycodes_Button.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
mycodes_Button.setPressed(true);
return true;
}
});