在Android4.0api以上版本中, 当viewpager.set继承FragmentStatePagerAdapter的adapter时有时会返回java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.解决方法是:
在viewpager的item fragment中的oncreateView方法中,使用inflater.inflate(view, null), 不要使用inflater.inflate(view, container)