Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a two view flippers in my fragment, in one I flip 3 views and in the other 2. I flip all views and then proceed to the next fragment. If on this next fragment I hit the back button, the app crashes with this in the logcat:
Activity has leaked IntentReceiver android.widget.ViewFlipper$1@41e58cc0 that was originally registered here. Are you missing a call to unregisterReceiver()?

I have researched this a lot and the common solution is to implement a custom view flipper, which I have done:
C#
public class CustomViewFlipper extends ViewFlipper {
    public CustomViewFlipper(Context context) {
        super(context);
    }
    public CustomViewFlipper(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    @Override
    protected void onDetachedFromWindow() {
        try {
            super.onDetachedFromWindow();
        }
        catch (IllegalArgumentException e) {
            stopFlipping();
        }
    }
}


However this doesn't resolve the issue. Has anyone been able to resolve this? I know that there is a bug in view flipper, if anyone could help with this I'd appreciate it
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900