• 如何限制listview的显示个数


    如何限制供热gridview 和listview显示的个数;

    思路问题:加载两个,我只拿两条出来

    Log.i("查询结果", result);
         JSONObject jsonObject = new JSONObject(result);
         map.put("code", jsonObject.getString("code"));// 状态0异常 1正常
         JSONArray jsonArray = jsonObject.getJSONArray("data");
         JSONObject jsonObject2;
         for (int i = 0; i < 2; i++) {
          Map<String, Object> map = new HashMap<String, Object>();
          jsonObject2 = (JSONObject) jsonArray.opt(i);
          map.put("id", jsonObject2.getInt("id"));// 视频id
          map.put("name", jsonObject2.getString("name"));// 视频名称
          map.put("imgPath", jsonObject2.getString("imgPath"));// 预览图地址
          map.put("videoPath", jsonObject2.getString("videoPath"));// 视频路径
          map.put("duration", jsonObject2.getString("duration"));// 视频长度
          map.put("integral", jsonObject2.getString("integral"));// 积分
          map.put("createTime",
            jsonObject2.getString("createTime"));// 创建时间
          map.put("watchCount", jsonObject2.getInt("watchCount"));// 观看次数
          map.put("createTime",
            jsonObject2.getString("createTime"));// 创建时间
          // map.put("bitmap",
          // Net.getBitmap(jsonObject2.getString("imgPath")));//
          // 广告图片
          map.put("path", jsonObject2.getString("imgPath"));
          videolist.add(map);

     

  • 相关阅读:
    单例模式
    java笔记 chapter7 抽象类和数组
    java笔记 chapter6 StringBuffer类和String Bulider类,Math类 Date类,Calendar类
    设计上的若干问题
    Java中的二次分发
    关于抽象
    SSI框架下同一个Bean加载了2次问题解决
    Hello 2015
    关于window.location.href is not a function在FF,chrom报错问题
    使用Eclipse的一些小心得!
  • 原文地址:https://www.cnblogs.com/childhooding/p/4461759.html
Copyright © 2020-2023  润新知