You have to do nothing what you are trying
Replace this
pax_id.setText(elements.getPaxId());
to
layout.setId(Integer.parseInt(elements.getPaxId()));
And in your Layout Click
layout.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(), "this is my Toast message!!! =)"+layout.getId(), Toast.LENGTH_LONG).show();
}
});
Every time you will get the Unique ID that u want to set
All the best...!!!!