This is mycode:
LatLngBounds.Builder builder = new LatLngBounds.Builder();
for(int x = firstVisibleItem; x < lastVisibleItem; x++){
builder.include(temp.getPosition());
}
However this line throws an error (java.lang.IllegalStateException: no included points
:
double north = builder.build().northeast.latitude;
This is because the above loop didn't run at all so no points were included in the builder
.
How can I check if the builder has at least one point?
I tried builder.build()!=null
which throws the above error and builder!=null
which is always True.
try{}catch(IllegalStateException e){ }
works. Is it stupid to ask a !=null
way? Mico-management? Thanks
if(firstVisibleItem< lastVisibleItem)
– Mcripley