网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
11月30日漏签0天
androidstudio吧 关注:14,648贴子:41,285
  • 看贴

  • 图片

  • 吧主推荐

  • 游戏

  • 1回复贴,共1页
<<返回androidstudio吧
>0< 加载中...

求助

  • 只看楼主
  • 收藏

  • 回复
  • Leodxw
  • 默默无闻
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
毕业设计做的是一款足球新闻app 用的是android studio 语言是java,数据库用的是bmob,遇到点问题,主页的数据正常的显示了,但是显示显示球队排名的这一页数据不显示了,先贴几张图片,如果不行的话我可以贴源码,求大神帮我看看。
liga
public class LigaCategoryFragment extends Fragment{
private MainActivity mainActivity;
private ListView listView2_category_liga;
private LinearLayout load_layout;
private ArrayList<ClubInfo>clubInfos=new ArrayList<>();
private ClubListItemAdapter clubListItemAdapter;
@Override
public void onAttach(Context context) {
super.onAttach(context);
mainActivity= (MainActivity) getActivity();
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view=inflater.inflate(R.layout.fragment_category,null);
listView2_category_liga=view.findViewById(R.id.listView2_category);
load_layout=view.findViewById(R.id.load_layout);
clubListItemAdapter=new ClubListItemAdapter(mainActivity,clubInfos);
listView2_category_liga.setAdapter(clubListItemAdapter);
loadData();
return view;
}
//初始化数据
private void loadData() {
if (clubInfos.size()==0){
load_layout.setVisibility(View.VISIBLE);
listView2_category_liga.setVisibility(View.GONE);
BmobQuery<ClubInfo>query=new BmobQuery<>();
query.setCachePolicy(BmobQuery.CachePolicy.CACHE_ELSE_NETWORK);
query.addWhereEqualTo("categoryId ","5yVY444B");
query.findObjects(mainActivity, new FindListener<ClubInfo>() {
@Override
public void onSuccess(List<ClubInfo> list) {
load_layout.setVisibility(View.GONE);
listView2_category_liga.setVisibility(View.VISIBLE);
clubListItemAdapter.setClubInfos((ArrayList<ClubInfo>) list);
clubListItemAdapter.notifyDataSetChanged();
}
@Override
public void onError(int i, String s) {
load_layout.setVisibility(View.GONE);
listView2_category_liga.setVisibility(View.VISIBLE);
}
});
}
}
}
viewholder
public class ViewHolder {
public static <T extends View>T getView(View view, int id){
SparseArray<View> viewHolder=(SparseArray<View>)view.getTag();
if(viewHolder==null){
viewHolder=new SparseArray<>();
view.setTag(viewHolder);
}
View v = viewHolder.get(id);
if(v==null){
v=view.findViewById(id);
viewHolder.put(id,v);
}
return (T) v;
}
}
clubItemadapter
public class ClubListItemAdapter extends BaseAdapter{
private String path =Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)+"/FootballnewStore";
private Context context;
private ArrayList<ClubInfo>clubInfos;
private BitmapUtils bitmapUtils;
public ClubListItemAdapter(Context context, ArrayList<ClubInfo>clubInfos){
this.context=context;
this.clubInfos=clubInfos;
bitmapUtils= new BitmapUtils(context,path);
bitmapUtils.configDefaultBitmapMaxSize(100,100);
}
@Override
public int getCount() {
return clubInfos.size();
}
@Override
public Object getItem(int position) {
return clubInfos.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView==null){
convertView= LayoutInflater.from(context).inflate(R.layout.data_list_item,null);
}
TextView tv_pm=ViewHolder.getView(convertView,R.id.textView_pm);
TextView tv_name=ViewHolder.getView(convertView,R.id.textView1_name);
TextView tv_cc=ViewHolder.getView(convertView,R.id.textView2_cc);
TextView tv_win=ViewHolder.getView(convertView,R.id.textView3_win);
TextView tv_lose=ViewHolder.getView(convertView,R.id.textView6_lose);
TextView tv_pg=ViewHolder.getView(convertView,R.id.textView4_pg);
TextView tv_jf=ViewHolder.getView(convertView,R.id.textView5_jf);
ImageView imageView_cm=ViewHolder.getView(convertView,R.id.imageView_club);
ClubInfo clubInfo=clubInfos.get(position);
tv_pm.setText(clubInfo.getRanking());
tv_name.setText(clubInfo.getClubname());
tv_cc.setText(clubInfo.getChangci());
tv_win.setText(clubInfo.getWin());
tv_lose.setText(clubInfo.getLose());
tv_pg.setText(clubInfo.getPing());
tv_jf.setText(clubInfo.getJifen());
//显示图片
bitmapUtils.display(imageView_cm,clubInfo.getClubimage().getFileUrl(context));
return convertView;
}
public ArrayList<ClubInfo>getClubInfos(){
return clubInfos;
}
public void setClubInfos(ArrayList<ClubInfo> clubInfos) {
this.clubInfos = clubInfos;
}
}


  • Leodxw
  • 默默无闻
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 1回复贴,共1页
<<返回androidstudio吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示