Android4.0 bug Can not perform this action after onSaveInstanceState - How to prevent?

Please check my answer here. Basically I just had to :

@Override
protected void onSaveInstanceState(Bundle outState) {
    //No call for super(). Bug on API Level > 11.
}

don't make the call to super() on the saveInstanceState method. This was messing things up...

EDIT: after some more research, this is a know bug in the support package.

If you nead to save the instance, and add something to your outState Bundle you can use the following :

@Override
protected void onSaveInstanceState(Bundle outState) {
    outState.putString("WORKAROUND_FOR_BUG_19917_KEY", "WORKAROUND_FOR_BUG_19917_VALUE");
    super.onSaveInstanceState(outState);
}
posted @ 2012-09-20 11:09  sfshine  阅读(360)  评论(0编辑  收藏  举报