zoukankan      html  css  js  c++  java
  • listview数据的添加

    /**
    * 加载notification内容
    */
    private void loadNotifiListView() {
    notifiListView = (ListView) findViewById(R.id.notifi_list);
    ArrayList list = new ArrayList();
    HashMap map;
    map = new HashMap();
    map.put("id", 1);
    map.put("notiIcon", R.drawable.ic_launcher);
    map.put("notiInfo",
    "您的支付P123456798已经生成,请确认付款之后通过Live Chat联系SEAGM在线客服在核实汇款信息后将为您支付订单。");
    map.put("notiTime", "2 hours ago");
    list.add(map);
    map = new HashMap();
    map.put("id", 2);
    map.put("notiIcon", R.drawable.ic_launcher);
    map.put("notiInfo",
    "您的支付P123456798已经生成,请确认付款之后通过Live Chat联系SEAGM在线客服在核实汇款信息后将为您支付订单。");
    map.put("notiTime", "2 hours ago");
    list.add(map);
    SimpleAdapter adapter = new SimpleAdapter(this, list,
    R.layout.notification_list_item, new String[] { "notiIcon",
    "notiInfo", "notiTime" }, new int[]{R.id.item_image,R.id.item_info,R.id.item_time});
    notifiListView.setAdapter(adapter);
    notifiListView.setOnItemClickListener(new OnItemClickListener() {

    @Override
    public void onItemClick(AdapterView<?> parent, View view,
    int position, long id) {
    // TODO Auto-generated method stub
    HashMap map = (HashMap) parent.getItemAtPosition(position);
    Log.e("error123", map.get("id").toString());
    }
    });
    }

  • 相关阅读:
    Django Rest framework 之 节流
    Django Rest framework 之 权限
    Django Rest framework 之 认证
    url参数和字典的相互转化
    Ajax之跨域请求
    爬虫之爬取B站关键字
    Django之ModelForm组件
    C语言逻辑运算符顺序
    2.4.4 N-S流程图表示法
    2.4.3 三种基本结构和改进的流程图
  • 原文地址:https://www.cnblogs.com/xingmeng/p/2446103.html
Copyright © 2011-2022 走看看