Long.getLong() failing, returning null to valid string

前端 未结 5 1266
遥遥无期
遥遥无期 2020-12-16 09:44

I\'ve spent the past two hours debugging what seems extremely unlikely. I\'ve stripped the method of a secondary Android Activity to exactly this:

public voi         


        
5条回答
  •  长情又很酷
    2020-12-16 10:01

    You are missing the fact that Long.getLong(String str) is not supposed to parse a String to a long, but rather to return a long value of a system property represented by that string. As others have suggested, what you actually need is Long.parseLong(String str).

提交回复
热议问题