getViewForId() Often returns null
I don't really know what else I can say about this. It seems the library can't find a view at times, and causes random NPE crashes internally when it happens because callers of getViewForId() always assume the result is not null. This library doesn't seem to be under development anymore either, so posting this in the hopes that someone else has run into this and found a cause/solution.
I believe this is part of a deeper problem, as it seems #46, #8, and #36 are all possibly related.
Update: I think my coworker solved the problem in #58. This at least covers the issues we've seen with this in the past.
I found that it would not crash if the layout_height of DynamicGridView was set wrap_content.
Finally,I found the error method:
private Point getColumnAndRowForView(View view) {
int pos = getPositionForView(view);
int columns = getColumnCount();
int column = pos % columns;
int row = pos / columns;
return new Point(column, row);
}
Modify: pos = getPositionForView(view) - getFirstVisiblePosition();
Everything is fine.