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

Android ExpandableListView / ExpandableListActivity 使用及数据更新

 2010-08-21 06:33:00 来源:WEB开发网   
核心提示:>< Buttonandroid:id="@+id/add_ok"android:layout_width="90dip"android:layout_height="wrap_content"android:text="OK"

>

< Button

android:id="@+id/add_ok"

android:layout_width="90dip"

android:layout_height="wrap_content"

android:text="OK"

/>

< Button

android:id="@+id/add_no"

android:layout_width="90dip"

android:layout_height="wrap_content"

android:text="NO"

/>

< /LinearLayout>

< /LinearLayout>

* add.xml 里 View 的定义:

Xml代码

public void createDialogAdd(){

viewAdd = this.getLayoutInflater().inflate(R.layout.add, null);

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

}

});

}

public void createDialogAdd(){

viewAdd = this.getLayoutInflater().inflate(R.layout.add, null);

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