I have a linearlayout, which contains my TextView I want access. In this linearlayout there is a listview, where every item is a linearlayout and contains also custom views.
Deep in there is a button with an onclickListener
. After performing onClick()
, I want to call a method which sets the text of my textview.
At the moment I am doing it like this:
(View)this.getParent().getParent().getParent().getParent().getParent().getParent().getParent().findViewById(R......)
It works, but it looks bad. Is there any possibility to do it a better way?