On a match I need all the elements of an array index passed to another activity. Here's what I have...
Intent LocationReview = new Intent(v.getContext(), ReviewActivity.class);
// iterate through array
for (int i = 0; i < locationReview.size(); i++) {
int locationID = locationReview.get(i).id;
int currentID = Integer.parseInt(tvId.getText().toString());
// compare id no. at index i of array
if ((locationReview.get(i).id == Integer.parseInt(tvId.getText().toString()))) {
// if match set putExtra array to locationReview.get(i)
**LocationReview.putParcelableArrayListExtra("locationReview", locationReview.get(i));**
itemView.getContext().startActivity(LocationReview);
} else {
Log.e("VerticalAdapter", "no matcon on locationReview");
}
}
The if statment compares the id
element in the locationReview array. If the element matches the string in the text view I need array index of i
, and all its elements, added as a pracelable array and added as Extra to my intent.