public void onDriveButtonClicked ( View arg0 ) { Log . d ( TAG , "Drive button clicked." ) ; if ( ! mSubscribedToInfiniteGas && mTank <= 0 ) alert ( R . string . out_of_gas_msg ) ; else { if ( ! mSubscribedToInfiniteGas ) -- mTank ; saveData ( ) ; alert ( R . string . spent_gas_msg ) ; updateUi ( ) ; Log . d ( TAG , "Vrooom. Tank is now " + mTank ) ; } }
Drive button clicked . Burn gas!