Max length of a string variable in Android

后端 未结 3 906
北恋
北恋 2020-12-19 07:23

There seems to be a max length to how many chars a string can hold. In my case it’s being populated with HTML via JSON and at around 1500 chars it crashes.

There are

3条回答
  •  旧巷少年郎
    2020-12-19 08:21

    The maximums (both practical and theoretical) are far higher. Theoretically, it's 2^31 - 1 characters. In practice, you'll be limited to available memory, but even on a mobile system you'll have more than 1.5KB.

    You have a different issue. Use JSON Lint to first check that you have valid JSON.

提交回复
热议问题