Android: Json string with spaces gives “Unterminated object at” exception

前端 未结 3 659
萌比男神i
萌比男神i 2020-12-11 05:25

Whenever I have a Json string object with a space in it I get the following error.

Java:

String jString = getResources().getString(R.string.event);
         


        
3条回答
  •  一向
    一向 (楼主)
    2020-12-11 05:44

    Reading through my own post I noticed that the error message doesn't have any quotes around the string object values. So I changed the " to \" in the xml string and it worked fine.

提交回复
热议问题