android 线程 进程
总结的不错的博文 http://hi.baidu.com/canghaiyisu123/blog/item/da6c652b94b6852a5243c15e.html http://blog.csdn.net/cjjky/article/details/6684959 本文转自老Zhan博客园博客,原文链接:http://www.cnblogs.com/mybkn/archive/2012/07/12/2587640.html,如需转载请自行联系原作者
使用BaseExpandableListAdapter 可以实现所谓的可折叠的列表,例如QQ里好友的分组的功能。
BaseExpandableListAdapter与BaseAdapter的基本原理是一样的,只不过在传入list的时候,要传入两组,一组是groupArray ,一组时childArray,前者用于组名(类似QQ的好友、同学、朋友),后者的每个元素都是一组子数据(类似QQ同学中的张三,李四的集合),实现adapter
public class ExpandableAdapter extends BaseExpandableListAdapter{ private LinkedList<TeacherSumGroupsModel> groupArray; private List<LinkedList<TeacherSumGroupDetailModel>> childArray; private Context context; private LayoutInflater inflater; public ExpandableAdapter(Context context,LinkedList<TeacherSumGroupsModel> courseGroupList, List<LinkedList<TeacherSumGroupDetailModel>> childArray){ inflater = ((Activity) context).getLayoutInflater(); this.groupArray = courseGroupList; this.childArray = childArray; } public int getGroupCount() { // TODO Auto-generated method stub return groupArray.size(); } public int getChildrenCount(int groupPosition) { // TODO Auto-generated method stub return childArray.get(groupPosition).size(); } public Object getGroup(int groupPosition) { // TODO Auto-generated method stub return groupArray.get(groupPosition); } public Object getChild(int groupPosition, int childPosition) { // TODO Auto-generated method stub return childArray.get(groupPosition).get(childPosition); } public long getGroupId(int groupPosition) { // TODO Auto-generated method stub return groupPosition; } public long getChildId(int groupPosition, int childPosition) { // TODO Auto-generated method stub return childPosition; } public boolean hasStableIds() { // TODO Auto-generated method stub return false; } public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { // TODO Auto-generated method stub TextView title; if(convertView == null){ convertView = inflater.inflate(R.layout.simple_listview_item, parent, false); } title = (TextView) convertView.findViewById(R.id.simple_listview_textview); String t = " "+groupArray.get(groupPosition).getname(); title.setText(t); return convertView; } public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { // TODO Auto-generated method stub TextView title; if(convertView == null){ convertView = inflater.inflate(R.layout.simple_listview_item, parent, false); } title = (TextView) convertView.findViewById(R.id.simple_listview_textview); String account = childArray.get(groupPosition).get(childPosition).getAccount(); String name = childArray.get(groupPosition).get(childPosition).getName(); String t = account +" "+name; Log.e("sumlist", "info is " +t); title.setText(t); return convertView; } public boolean isChildSelectable(int groupPosition, int childPosition) { // TODO Auto-generated method stub return true; } }
代码摘自现在的某个项目。
类似与BaseAdapter的关键getView方法,这里比较重要的是getGroupView和getChildView方法,其实内部实现都是类似的。
本文转自老Zhan博客园博客,原文链接:http://www.cnblogs.com/mybkn/archive/2012/06/18/2553637.html,如需转载请自行联系原作者
微信关注我们
转载内容版权归作者及来源网站所有!
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。
Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。
Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。
Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。