NoSaveStateFrameLayout wrapper = new NoSaveStateFrameLayout(child.getContext());
ViewGroup.LayoutParams childParams = child.getLayoutParams();
if (childParams != null) {
wrapper.setLayoutParams(childParams);
}
NoSaveStateFrameLayout.LayoutParams lp = new NoSaveStateFrameLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
child.setLayoutParams(lp);
wrapper.addView(child);
return wrapper;