For some reason the implementation of getMaxAddressLineIndex has recently changed. Now this method returns 0 for line 1.
I have an existing code, which used to work: i<address.getMaxAddressLineIndex(
). However, it is broken somehow.
I don't know if it is due to the new Google Api or something else.
Can someone please confirm me here what is going on?
I had the same issue and this just a workaround.
if (address.getMaxAddressLineIndex() > 0) {
for (int i = 0; i < address.getMaxAddressLineIndex(); i++) {
addressFragments.add(address.getAddressLine(i));
}
} else {
try {
addressFragments.add(address.getAddressLine(0));
} catch (Exception ignored) {}
}
Hope this help