1.继承BaseFragment。 2.重新getLayoutId()加载对应页面。 3.重新initView()初始化页面控件。 4.重新initData()加载数据 ~~~ /** * 店铺商品列表 * * @author cm * */ public class ShopDetailWork extends BaseFragment { RTPullListView pullListView; ServiceAndGoodAdapter itemAdapter; ProgressBar moreProgressBar; View Lastview; ArrayList<HashMap<String, Object>> workList; int page = 1; // 页码 String strShopId; private static final int LOAD_MORE_SUCCESS = 3; private static final int LOAD_NEW_INFO = 5; ViewGroup.LayoutParams params; public ShopDetailWork(String strShopId2) { strShopId = strShopId2; } @Override protected int getLayoutId() { return R.layout.shop_detail_good_service; } @Override protected void initView() { pullListView = (RTPullListView) findView(R.id.pullListView); LayoutInflater layoutInflater = LayoutInflater.from(getActivity()); Lastview = layoutInflater.inflate(R.layout.list_footview, null); RelativeLayout footerView = (RelativeLayout) Lastview .findViewById(R.id.list_footview); moreProgressBar = (ProgressBar) Lastview.findViewById(R.id.footer_progress); pullListView.addFooterView(footerView); } @Override protected void initData() { workList = ShopDetailDP.getShopWork(strShopId, page, getActivity()); itemAdapter = new ServiceAndGoodAdapter(getActivity(), workList, "1"); pullListView.setAdapter(itemAdapter); // 动态算出ListView的LayoutParams,并设置到ListView中 params = StrFormat.getListViewParams(pullListView); pullListView.setLayoutParams(params); } } ~~~