猿问

想问下每行的代码注释

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;

    } 



cuni
浏览 1089回答 1
1回答

xleon

这个没什么意思啊SetAdapter取出数据ViewHolder
随时随地看视频慕课网APP

相关分类

Android
我要回答