Code example for Handler

Methods: sendEmptyMessageDelayed

    protected void onStart() { 
        if (mShowWarningIcon) {
            // Disable keyguard 
            // start icon animation 
            mAnimationHandler.sendEmptyMessageDelayed(0, WARNING_ICON_ON_DURATION_MSEC);
     * Stop animating warning icon and stop the {@link CellBroadcastAlertAudio} 
     * service if necessary. 
    protected void onStop() { 
        // Stop playing alert sound/vibration/speech (if started) 
        Context context = getContext();
        context.stopService(new Intent(context, CellBroadcastAlertAudio.class));
        // Start database service to mark broadcast as read 
        Intent intent = new Intent(context, CellBroadcastDatabaseService.class);
Contextual code suggestions in your IDE  Get Codota for Java