public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) //创建该fragment对应的视图,并返回给调用者 { View mView = inflater.inflate(R.layout.main_menu_baimishop_frag,container,false ); //创建店铺数据库实例 mShopDB = new ShopDB(getActivity()); shop_content = (ListView)mView.findViewById(R.id.list); mData = getShopDatas(); mMyAdaper = new MyAdapter(container.getContext()); shop_content.setAdapter(mMyAdaper); return mView; } private List<Shop> getShopDatas(){ List<Shop> shop = new ArrayList<Shop>(); shop = mShopDB.getShops(); return shop; } public final class ViewHolder{ public LinearLayout shop_ll; public ImageView img; public TextView name_tv; public TextView score_tv; }
添加回答
举报
0/150
提交
取消