@@ -0,0 +1,1550 @@
+/* @(#)SafeViewFlipper.java%0A *%0A *========================================================================%0A * Copyright 2011 by Zeo Inc. All Rights Reserved%0A *========================================================================%0A *%0A * Date: $Date$%0A * Author: Christopher Souvey %3Cchristopher.souvey@myzeo.com%3E%0A * Version: $Revision$%0A */%0A%0Apackage com.androsz.electricsleepbeta.widget;%0A%0Aimport android.content.Context;%0Aimport android.util.AttributeSet;%0Aimport android.util.Log;%0Aimport android.widget.ViewFlipper;%0A%0A/**%0A * View flipper that protects against against crashes during screen rotations.%0A *%0A * @author Christopher Souvey%0A * @version $Revision$%0A */%0Apublic class SafeViewFlipper extends ViewFlipper %7B%0A%0A    private static final String TAG = SafeViewFlipper.class.getSimpleName();%0A%0A    public SafeViewFlipper(Context context) %7B%0A        super(context);%0A    %7D%0A%0A    public SafeViewFlipper(Context context, AttributeSet attrs) %7B%0A        super(context, attrs);%0A    %7D%0A%0A    /**%0A     * Workaround for Android Bug 6191:%0A     * http://code.google.com/p/android/issues/detail?id=6191%0A     * %3Cp/%3E%0A     * ViewFlipper occasionally throws an IllegalArgumentException after screen%0A     * rotations.%0A     */%0A    @Override%0A    protected void onDetachedFromWindow() %7B%0A        try %7B%0A            super.onDetachedFromWindow();%0A        %7D catch (IllegalArgumentException e) %7B%0A            Log.d(TAG, %22SafeViewFlipper ignoring IllegalArgumentException%22);%0A            // Call stopFlipping() in order to kick off updateRunning()%0A            stopFlipping();%0A        %7D%0A    %7D%0A%7D

Add a safe view flipper to prevent crashes during screen rotations while flipper is flipping.