Sometimes I notice that, for a View v
- v.hasWindowFocus()==false
- ((View)v.getParent()).hasWindowFocus())==true
If I understand the docs c
The main reason is that ListView doesn't like an adapter having an array of views.
So the problem is triggered by code like
public View getView (int position, View convertView, ViewGroup parent)
{
return _views[position];
}
When looking at the ListView code (or rather it's parents AbsListView.obtainView method) you'll see code like
if (scrapView != null) {
...
child = mAdapter.getView(position, scrapView, this);
...
if (child != scrapView) {
mRecycler.addScrapView(scrapView);
It can happen that getView(position,...)
is called with scrapView != _views[position] and hence scrapView will be recycled. On the other hand, it is quite likely that the same view is also added again to ListView, resulting in views getting weird states.
This should be fixed in ListView IMO.