用 TestFragment extends Fragment
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState)
{
View view1 = new View(getActivity());
View view = inflater.inflate(R.layout. ad_main , null
);这里不能有ViewGroup参数,不然认为同一组,报错。
TextView text = (TextView)view.findViewById(R.id. SlideTitle
);
text.setText( mContent );
return view;
}
相关文章
- 关于报错The specified child already has a parent的解决办法
- 报错信息为:java.lang.IllegalStateException: The specified child already has a parent.
- Android RecyclerView 报错:java.lang.IllegalStateException: The specified child already has a...
- viewpager加载fragment出错Caused by: java.lang.IllegalStateException: The specified child already has a p
- java.lang.IllegalStateException: The specified child already has a parent. You m
- 当使用ViewPager滑动发生java.lang.IllegalStateException: The specified child already has a parent.异常时的解决方案
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
- mark一下android异常 java.lang.IllegalStateException: The specified child already has a parent. You must
- 安卓java.lang.IllegalStateException: The specified child already has a parent.解决方案