1.获取数据 2.初始化可分页GridView 3.绑定自定义适配器IndexCateAdapter ~~~ slist = (ArrayList<HashMap<String, Object>>) msg.obj; IndexCateAdapter adapter = new IndexCateAdapter(slist, getActivity()); pageGridView2.setAdapter(adapter); pageGridView2.setOnItemClickListener(adapter); if (slist.size() > 8) { // 设置分页指示器 pageGridView2.setPageIndicator(pageIndicator); } ~~~ 4.空数据补齐空缺的item ~~~ @Override public HashMap<String, Object> getEmpty() { HashMap<String, Object> map = new HashMap<String, Object>(); map.put("id", "-1"); map.put("pid", "-1"); map.put("name", ""); map.put("pic", ""); return map; } ~~~ 5.GridView item点击事件 ~~~ @Override public void onItemClick(PageGridView pageGridView, int position) { if (TextUtils.isEmpty(mData.get(position).get("name").toString())) { } else { Bundle bundle = new Bundle(); bundle.putString("id", mData.get(position).get("id").toString()); bundle.putString("name", mData.get(position).get("name").toString()); Intent intent = new Intent(context, SearchResult.class); intent.putExtra("type", 0); intent.putExtra("search_type", "cate"); intent.putExtra("cate_id", mData.get(position).get("id").toString()); intent.putExtra("cate_name", mData.get(position).get("name").toString()); context.startActivity(intent); } } ~~~