0
Guys, I have the code below. I created a FloatingActionButton
who takes pictures of all the items that are on ListView
, but the method list.getChildAt(i). isEnable is returning nullpointer. Some idea to solve?
ListView list = JTaritronClientReportFragment.getInstance().getList();
list.setSelection(0);
int j=0;
while (j<list.getCount()) {
int lastPosition = list.getLastVisiblePosition();
for (int i = 0; i < list.getLastVisiblePosition() - list.getFirstVisiblePosition(); i++) {
if (list.getChildAt(i).isEnabled()) {
JUtil.saveScreenShot(list.getChildAt(i), "operadora" + j + ".png");
j++;
}
}
list.setSelection(lastPosition);
}
i took another look at the code and is updating only if (list.getChildAt(i).isEnabled()) is returning nullpointer, I will change the question
– Eduardo Bonfa
It is returning null, probably because in its list in the getChildAt element( i ) it may be empty.
– Leonardo Rocha
i think q is returning null pq is not appearing on the screen, for example I have a listview with 6 items, it takes picture of the first three twice, then updates the screen
– Eduardo Bonfa