I have a ListView items/cell that has a few layers, relative, linearLayout etc. I tried doing v.getParent() inside the onClick of the button but it just went one layer up. How can I get a reference to the root of the current element inside onClick event handler?
Here is my getView()
Button v = (Button)findViewById(R.id.myButton);
v.setOnClickListener(new OnClickListener(){
onClick(View v) {
//Right here I want to find another view inside the cell.
View otherView = ???.findViewById(R.id.myOtherViewInListItem);
otherView.setBackgroundColor(...);
.........................................
}
});