Get data from a ListView item and send to another activity (Android)

时间:2015-10-30 22:03:46

标签: android android-intent android-listview

I am trying to send this object information to another activity with intent. All information is in this picture.

Image

2 个答案:

答案 0 :(得分:0)

First Activity

Intent intent = new Intent(getApplicationContext(),AnotherActivity.class);
intent.putSerializable("VALUE", listItem);

Second Activity

Intent intent=this.getIntent();
Object list = intent.getSerializable("VALUE");

答案 1 :(得分:0)

Please change Object to GeoLabStudent

you should use adapter's reference to get item

GeoLabStudent object = (GeoLabStudent)geoLabAdapter.getItem(position);

Make your model GeoLabStudent to serializable or parcelable for sending your object to other activity

Example