public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener
@Override
public void onClick(View view) {
int data = getAdapterPosition();
/*
Intent in = new Intent(getContext(),NextActivity.class);
in.putExtra("data",mTextView.getText().toString());
startActivity(in);
*/
// Flower current = ls.get(position);
## Heading ##
int itemPosition = recycelr.getChildLayoutPosition(view);
Flower item = fl_List.get(itemPosition);
Intent in = new Intent(getContext(),NextActivity.class);
in.putExtra("id",0);
in.putExtra("data",item.getName());
startActivity(in);
}
Nguồn
2016-07-08 07:45:22
Có thể minh họa một chút về điều này, bạn làm cách nào để có được vị trí của ô được nhấp? – aprofromindia
Bạn có thể hiển thị thêm dữ liệu hoặc mã để hiểu những gì bạn cần – IgniteCoders