在下面的代码中,单击列表项时,我想获取对象内部存在的变量,如何实现这一点
下面是代码片段
private void onListViewItemClick() {
// TODO Auto-generated method stub
// item click switch to next activity
listCustomListViewId.setOnItemClickListener(new OnItemClickListener() {
/* on click gets list view item id */
public void onItemClick(AdapterView<?> myAdapter, View myView,
int myItemInt, long mylng) {
// fetching clicked item id
Object o = listCustomListViewId.getItemAtPosition(myItemInt);
Log.i("Victory Item Id:.....", String.valueOf(o);
long strid = (long) (listCustomListViewId
.getItemIdAtPosition((int) mylng));
Log.i("Item Id...#######", String.valueOf(strid));
/* switch on next 'ListItemDeleteUpdateActivity' activity */
Intent intent = new Intent(FeedsActivity.this,
VictoryDetailActivity.class);
intent.putExtra("customElements", o.toString());
startActivity(intent);
}
});
}
我试图将数据放入 Object 但无法获取。