我有 3String[] array
DateArray[]={"17/09/2012","18/09/2012","19/09/2012"};
Visit[]={"4","10","2"};
Distance[]={"30","100","45"};
我想在这样的 ListView 中显示这个数组 我已经制作了 XML 我只想填充这 3 个值 这是一个ListActivity
我试过
我怎样才能做到这一点
单击我正在使用的 ListView
listView.setAdapter(new ObjAdapter(this, R.layout.claimlistview, items));
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
Object o = listView.getItemAtPosition(position);
TextView t1=(TextView)findViewById(R.id.ClaimDate);
if(t1!=null){
ClaimListBean mSelected;
int idx=position;
mSelected=m_adapter.getItem(idx);
String Date=mSelected.getDate();
//StringTokenizer tokens = new StringTokenizer(Date, "(");
//String first = tokens.nextToken();
//String second = tokens.nextToken();
String Visit=mSelected.getVisit();
String Distance=mSelected.getDistance();
//String EditedSecond = second.replace(")","");
Intent intent=new Intent(DRSTClaimList.this,DRSTClaimDetail.class);
intent.putExtra("Date", Date);
//intent.putExtra("Date", first);
//intent.putExtra("Day", EditedSecond);
intent.putExtra("Distance", Distance);
intent.putExtra("Visit", Visit);
startActivity(intent);
}