Android ExpandableListView / ExpandableListActivity 使用及数据更新
2010-08-21 06:33:00 来源:WEB开发网android:layout_width="200dip"
android:layout_height="wrap_content"
/>
< /LinearLayout>
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
< Button
android:id="@+id/delete_ok"
android:layout_width="90dip"
android:layout_height="wrap_content"
android:text="OK"
/>
< Button
android:id="@+id/delete_no"
android:layout_width="90dip"
android:layout_height="wrap_content"
android:text="NO"
/>
< /LinearLayout>
< /LinearLayout>
* delete.xml 里View 定义:
Java代码
public void createDialogDelete(){
viewDelete = this.getLayoutInflater().inflate(R.layout.delete, null);
dialogDelete = new Dialog(this);
dialogDelete.setContentView(viewDelete);
dialogDelete.setTitle("删除指定成员");
delete_id = (EditText)viewDelete.findViewById(R.id.delete_id);
delete_ok = (Button)viewDelete.findViewById(R.id.delete_ok);
delete_no = (Button)viewDelete.findViewById(R.id.delete_no);
delete_ok.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
// TODO Auto-generated method stub
String id = delete_id.getText().toString();
if(! id.equals("")){
int i = Integer.parseInt(id);
group.remove(i);
child.remove(i);
dialogDelete.dismiss();
mAdapter.notifyDataSetChanged();
}
}
});
delete_no.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
// TODO Auto-generated method stub
Tags:Android ExpandableListView ExpandableListActivity
编辑录入:coldstar [复制链接] [打 印]赞助商链接