WEB开发网
开发学院手机开发Android 开发 Android ExpandableListView / ExpandableListAct... 阅读

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

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"

上一页  5 6 7 8 9 10 11 12 13 14  下一页
赞助商链接