if ( ) {
pause();
button.setBackgroundResource(R.drawable.pause_bg);
} else {
resume();
button.setBackgroundResource(R.drawable.start_bg);
}
boolean pauseFlag = false;
if ( !pauseFlag) {
pause();
pauseFlag = true;
button.setBackgroundResource(R.drawable.pause_bg);
} else {
pauseFlag = false;
resume();
button.setBackgroundResource(R.drawable.start_bg);
}