Obtaining State abbreviation from getAdminArea();

后端 未结 4 1714
执笔经年
执笔经年 2021-01-11 16:24

I\'ve attempted two different ways in trying to obtain the city name as well as the state abbreviation only from the Address class, with no luck. The first is returning the

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-11 17:26

    This works for me on US addresses:

    String[] spState = addressInformation.get(0).getAddressLine(1).split(" ");
    String state = spState[1];
    

提交回复
热议问题