DragCar dCar = new DragCar();
dCar.poolId = car.pool_id;
dCar.postion=car.position;
dCar.railCarNumber = car.railcar_number;
dCar.status = car.status;
dCar.track = car.trackId;
dCar.type = car.type;
dCar.yard = car.yardId;
View view = new View(context);
view.setTag(dCar);
parent.addView(view);
View view = parent.findViewWithTag(dCar);
findviewwithtag(dCar)之后的视图返回null值。 DragCar是一个用于了解汽车的自定义类对象。