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

Android ExpandableListView / ExpandableListActivity 使用及数据更新

 2010-08-21 06:33:00 来源:WEB开发网   
核心提示:android:layout_width="200dip"android:layout_height="wrap_content"/>< /LinearLayout>< LinearLayout xmlns:android="http://sch

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

上一页  7 8 9 10 11 12 13 14  下一页
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接