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());
    }
    });
    }

  • 相关阅读:
    Nodejs:fs模块 & rimraf模块
    Nodejs:简单的脚手架(一)
    Nodejs:Glob对象
    Nodejs:Path对象
    后台系统组件:一丶bootstrap table
    关于Fekit的安装与测试
    Web存储-Web Storage
    【python】基础入门
    排除正则
    js正则处理千分位
  • 原文地址:https://www.cnblogs.com/xingmeng/p/2446103.html
Copyright © 2011-2022 走看看