I want functionality of toggle button in simple button.like

```
Button b=(Button)findViewById(R.id.x);
if(b.isChecked())
{
//do somthing
}
else
{
//do somthing
}

```

any one have any logic in mind ?i dont want toggle button so please help.