Android ExpandableListView / ExpandableListActivity 使用及数据更新
2010-08-21 06:33:00 来源:WEB开发网dialogAdd = new Dialog(this);
dialogAdd.setContentView(viewAdd);
dialogAdd.setTitle("输入新成员信息");
add_name = (EditText)viewAdd.findViewById(R.id.add_name);
add_phone = (EditText)viewAdd.findViewById(R.id.add_phone);
add_sex = (EditText)viewAdd.findViewById(R.id.add_sex);
add_home = (EditText)viewAdd.findViewById(R.id.add_home);
add_ok = (Button)viewAdd.findViewById(R.id.add_ok);
add_no = (Button)viewAdd.findViewById(R.id.add_no);
add_ok.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
// TODO Auto-generated method stub
String[] data = {
add_phone.getText().toString(),
add_sex.getText().toString(),
add_home.getText().toString()
};
addInfo(add_name.getText().toString(),data);
dialogAdd.dismiss();
mAdapter.notifyDataSetChanged();
}
});
add_no.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
// TODO Auto-generated method stub
dialogAdd.dismiss();
}
});
}
* 运行截图:
* 定义删除数据界面:delete.xml
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:layout_height="fill_parent"
>
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
Tags:Android ExpandableListView ExpandableListActivity
编辑录入:coldstar [复制链接] [打 印]更多精彩
赞助商链接