Buggy code:
public class OrderStateActivity extends Activity implements OnClickListener , CircleTimerListener { public static final String ORIGIN_FROM_PAY_ACTION = "pay" ; public static final String ORIGIN_FROM_QR_RESULT_ACTION = "qr_result" ; public static final int TIME_UPDATE = 1 ; private Context mContext ; private ImageView mBackIv ; private ImageView mQrcodeIv ; private RelativeLayout mWaitViewRl ; private TextView mStepOneTv ; private TextView mStepTwoTv ; private TextView mStepThreeTv ; private TextView mStepFourTv ; private TextView mTimingTv ; private ImageView mStepOneIv ; private ImageView mStepTwoIv ; private ImageView mStepThreeIv ; private ImageView mStepFourIv ; private Button mCancelBtn ; private String mNowAction = OrderStateActivity . ORIGIN_FROM_PAY_ACTION ; private CircleTimerView mTimerView ; private int mStateCode = 0 ; private String mDeliveryTime ; private int mTiming = 0 ; protected CustomProgressDialog2 mCustomProgressDialog ; Handler mHandler = new Handler ( ) { @ Override public void handleMessage ( Message msg ) { } } ; private Handler mTimeHandler = new Handler ( ) { public void handleMessage ( Message msg ) { } } ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void setUpViews ( ) { } private void setUpListener ( ) { } @ SuppressLint ( "ResourceAsColor" ) private void setUpData ( ) { String state = getIntent ( ) . getStringExtra ( "order_state" ) ; mDeliveryTime = getIntent ( ) . getStringExtra ( "delivery_time" ) ; if ( TextUtils . isEmpty ( mDeliveryTime ) ) { mDeliveryTime = TimeUtils . TimeStamp2Date ( String . valueOf ( ( ( System . currentTimeMillis ( ) ) + ( ( 20 * 60 ) * 1000 ) ) ) , FORMAT_PATTERN_DATE ) ; } mStateCode = Integer . parseInt ( state ) ; mTimeHandler . sendEmptyMessage ( OrderStateActivity . TIME_UPDATE ) ; switch ( mStateCode ) { case 0 : { break ; } case 3 : { mStepTwoTv . setTextColor ( BLACK ) ; mStepTwoTv . setText ( getString ( began_delivery ) ) ; mStepTwoIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; mWaitViewRl . setVisibility ( VISIBLE ) ; mTimingTv . setText ( "00:00:00" ) ; } case 4 : { mStepTwoTv . setTextColor ( BLACK ) ; mStepTwoTv . setText ( getString ( began_delivery ) ) ; mStepTwoIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; mStepThreeTv . setTextColor ( BLACK ) ; mStepThreeIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; } case 5 : { mStepTwoTv . setTextColor ( BLACK ) ; mStepTwoTv . setText ( getString ( began_delivery ) ) ; mStepTwoIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; mStepThreeTv . setTextColor ( BLACK ) ; mStepThreeTv . setText ( getString ( confirm_goods ) ) ; mStepThreeIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; mStepFourTv . setTextColor ( BLACK ) ; mStepFourTv . setText ( getString ( identification_goods ) ) ; mStepFourIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; } case 6 : { mStepTwoTv . setTextColor ( BLACK ) ; mStepTwoTv . setText ( getString ( began_delivery ) ) ; mStepTwoIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; mStepThreeTv . setTextColor ( BLACK ) ; mStepThreeTv . setText ( getString ( confirm_goods ) ) ; mStepThreeIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; mStepFourTv . setTextColor ( BLACK ) ; mStepFourTv . setText ( getString ( identification_goods ) ) ; mStepFourIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; } case 7 : { mStepTwoTv . setTextColor ( BLACK ) ; mStepTwoTv . setText ( getString ( began_delivery ) ) ; mStepTwoIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; mStepThreeTv . setTextColor ( BLACK ) ; mStepThreeTv . setText ( getString ( confirm_goods ) ) ; mStepThreeIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; mStepFourTv . setTextColor ( BLACK ) ; mStepFourTv . setText ( getString ( identification_goods ) ) ; mStepFourIv . setImageDrawable ( getResources ( ) . getDrawable ( dot_green ) ) ; } default : break ; } mCancelBtn . setVisibility ( VISIBLE ) ; <START_BUG> if ( ( mStateCode ) >= 5 ) { <END_BUG> mCancelBtn . setVisibility ( GONE ) ; } } @ Override public void onClick ( View v ) { } @ Override public void onTimerStop ( ) { } @ Override public void onTimerStart ( int time ) { } @ Override public void onTimerPause ( int time ) { } }

Fix:
if ( ( mStateCode ) < 3 ) {