The problem was caused by adding an incorrectly bloated header to two different lists.
I inflated the view using listViewA as a parent and adding it to listViewB . In this way:
RelativeLayout listViewHeader = (RelativeLayout) inflater.inflate(R.layout.listviewheader, listViewA, false); // Set some views listViewA.addHeaderView(listViewHeader); listViewB.addHeaderView(listViewHeader);
I fixed this by changing the above to the following:
RelativeLayout listViewHeaderA = (RelativeLayout) inflater.inflate(R.layout.listviewheader, listViewA, false); RelativeLayout listViewHeaderB = (RelativeLayout) inflater.inflate(R.layout.listviewheader, listViewB, false); listViewA.addHeaderView(listViewHeaderA); listViewB.addHeaderView(listViewHeaderB);
As for crash playback, the problem occurs when Google Talk Back is turned on. Here's my view of the situation: Google Talk Back makes text-to-speech from views that are in focus (either by touch or autofocus). When he enters a screen with several views, asking for focus, he reads the views in accordance with the hierarchy / order.
If you have a layout (parent) with three views (children), Google Talk Back checks how the views are arranged and then reads them accordingly. For example, in a layout with three textures aligned horizontally, Google Talk Back may first read the left text view, then the middle, and then the right.
In my case, I inflated the header with listViewA as the parent and added this view to both listViewA and listViewB . When listViewB gets focus and Google Talk Back tries to interpret its children, it sees that the title is not a child of the list and throws an exception. This also happens if I inflate the header without parents (null).
kyrax source share