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: <
As user8533943 has pointed out above the implementation has been changed surreptitiously. However I am of the opinion that
geocoder.getFromLocation()
has changed it's implementation. It returns a list of addresses and each address consists of address lines. But as far as I could see when I compiled with version 26 of the SDK there aren't "address lines" being returned but just one line for every address.
So if you have just one address then
getMaxAddressLineIndex()
would in fact return 0
Update your implementation as follows to use a <= comparison.
for(int i = 0; i <= address.getMaxAddressLineIndex(); i++) {
addressFragments.add(address.getAddressLine(i));