ExpandableListActivity】的更多相关文章

首先MainActivity继承自ExpandableListActivity,其中的声明如下: setContentView(R.layout.expandmain); //定义一个:List,该List对象为一级条目提供数据 List<Map<String,String>> parents = new ArrayList<Map<String,String>>(); Map<String,String> parent1 = new HashM…
[转]原地址  http://blog.163.com/xygzx@126/blog/static/237809502011102010100331/ 效果显示图: 1.布局文件 main.xml(ExpandableListActivity布局文件) 注意事项: ExpandableListActivity的布局文件中必须包含一个ExpandableListView,并且id必须为="@id/android:list".还可以包含一个id为empty的TextView,在Expand…
MainActivity.java package com.example.mars_2300_expandablelist; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBa…
package com.example.keKuoZhanLieBiao; import android.app.ExpandableListActivity; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.*; public class MyActivity e…
http://www.cnblogs.com/limingblogs/archive/2011/10/09/2204866.html 今天自己简单的总结了listActivity和ExpandableListActivity二者的简单用法. 首先,先说一下listActivity的用法: ListActivity是一个绑定到一个数据源,并且用来显示这一串数据的Activity.ListActivity拥有一个listview对象来实现数据源的绑定与显示,通常会是一个array或者一个拥有查询结果…
Android中常常要用到ListView,但也经常要用到ExpandableListView,ListView是显示列表,而ExpandableListView显示的是分类的列表: 下面用一个例子来说明: 还可以点击触发事件: 代码如下: activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://sch…
http://developer.android.com/reference/android/app/ExpandableListActivity.html# public class ExpandableListActivity extends Activityimplements View.OnCreateContextMenuListener ExpandableListView.OnChildClickListener ExpandableListView.OnGroupCollapse…
======MainActivity.java===================================== package com.zys.myexpandablelistactivity; import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map; import android.os.Bundle;import android.app.Activit…
activity_main.xml: <ExpandableListView android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawSelectorOnTop="false" /> <TextView android:id="@i…
main.xml: <?xml version="1.0" encoding="UTF-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:…