zoukankan      html  css  js  c++  java
  • Activity间传递list<Bean>的集合

    传递者:

    listView_Province.setOnItemClickListener(new OnItemClickListener() {

       @Override
       public void onItemClick(AdapterView<?> parent, View view, int position,
         long id) {
         Province currProvince = adapter_Province.getItem(position);// 获取当前被选中的省份
         List<City> list_city = currProvince.getList_city();// 获取该省份的城市的集合
         Intent  intent=new Intent(ProvinceActivity.this,CityActivity.class);
         Bundle bundle=new Bundle();
         bundle.putSerializable("list_city", (Serializable) list_city);
         bundle.putSerializable("list_district", (Serializable) list_district);
         intent.putExtras(bundle);
         startActivity(intent);
       }
      });

    接收者:

       listView_City = (ListView) findViewById(R.id.listView_City);

       Intent intent=getIntent();
        list_city=(List<City>) intent.getSerializableExtra("list_city");
       
       listView_City.setAdapter(new ArrayAdapter<City>(CityActivity.this, android.R.layout.simple_list_item_1,list_city));

  • 相关阅读:
    Spring spEL
    Spring 使用外部部署文件
    Spring 自动装配
    spring 属性配置细节
    hdu 1054 Strategic Game
    fzu 2037 Maximum Value Problem
    将博客搬至CSDN
    HDU 4714 Tree2Cycle
    HDU 1009 The Shortest Path in Nya Graph
    POJ 1942 Paths on a Grid 组合数的优化
  • 原文地址:https://www.cnblogs.com/Jingerxin/p/5102080.html
Copyright © 2011-2022 走看看