I am adding a child view to a Linear Layout. The child views itself has some textview and imageviews in a Relativelayout. The child view is added dynamically in the LinearLayout on clicking a button. Right now I am able to add the child view as shown in this pic. http://dl.dropbox.com/u/50249620/SC20120926-031356.png what I have to do is uniquely identify which child view has been clicked in order to show appropriate actions. My code where I am adding the child view.
addButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
customView1 = inflater.inflate(R.layout.people, null);
peopleName = (TextView) customView1.findViewById(R.id.peopleName);
peopleName.setText(autoComplete.getText());
customView1.setId(peopleInvitedRelativeLayout.getChildCount() + 1);
params4 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
customView1.setLayoutParams(params4);
peopleInvitedRelativeLayout.addView(customView1, params4);
}
});
Any help or suggestions would be appreciated. Thanks.