Yesterday I update my nexus 5 to lollipop and my application stops working, after a little investigation I found the problem the DhcpInfo isn't is returning null on the netmask variable.
I couldn't find any alternative to this class.
Yesterday I update my nexus 5 to lollipop and my application stops working, after a little investigation I found the problem the DhcpInfo isn't is returning null on the netmask variable.
I couldn't find any alternative to this class.
You can use
getNetworkPrefixLength
method ofInterfaceAddress
, which you get fromNetworkInterface
. It returns the correct value in Lollipop.Note: It returns network prefix length, so you'd have to convert it (/24 for 255.255.255.0 etc.)