Check LatLngBounds.Builder if null

前端 未结 1 1727
青春惊慌失措
青春惊慌失措 2021-01-19 13:56

This is mycode:

LatLngBounds.Builder builder = new LatLngBounds.Builder();
for(int x = firstVisibleItem; x < lastVisibleItem; x++){
    builder.include(te         


        
相关标签:
1条回答
  • 2021-01-19 14:10

    You can create a counter and use it to verify that you have at least one point.

    int counter = 0;
    LatLngBounds.Builder builder = new LatLngBounds.Builder();
    for(int x = firstVisibleItem; x < lastVisibleItem; x++){
        counter++;
        builder.include(temp.getPosition());
    }
    if (counter > 0) {
        //use a LatLngBounds.Builder to build the LatLngBounds object
    }
    
    0 讨论(0)
提交回复
热议问题