天天看點

listview 中取值

 1. listview.setonitemclicklistener(new onitemclicklistener() {

//@override

public void onitemclick(adapterview<?> arg0, view arg1,

int arg2, long arg3) {

string a= listview.getitematposition(arg2).tostring();

textview content=(textview)arg1.findviewbyid(r.id.title); 

      string sd= content.gettext().tostring();

      toast.maketext( mainact.this, sd, toast.length_long).show();

} });

 // a 顯示所選項目所有值

 // sd 為所選項目url項值

 //其中textview 設定maxlength=‘0’時,sd值為空

              maxlines或  maxems=‘0’ 時,sd值正常

繼續閱讀