首页 > 编程知识 正文

安卓 如何得到数组的反转,androidbyte数组定义

时间:2023-05-03 14:19:04 阅读:128355 作者:4701

iwanttogetdatafromphpfiletoandroidusingjson.this is my code :

.

HttpEntity e=r.getEntity (;

string data=entity utils.tostring (e;

返回最后;

whenidebugtheprogramthereisjsonexceptiononthisline :

Data is {'a':1,' b':2,' c':3,' d':4,' e ' :5 } and the exception is 3:

org.JSON.JSON exception : value { ' d ' :4,' e':5,' b':2,' c':3, ' a ' :1 } oftypeorg.JSON.jsonobjectcannotbeconvertedtosdfh/pheexceptionmessageisquiteeexplicitandalookatthejsonsyntathed

{'a':1,' b':2,' c':3,' d':4,' e':5}

This string represents an object,nota narray.anexampleofanarraywouldbethis :

or even this:

notethatstartingandclosingbrackets。

ithinkthatyouwillfindthattheexceptionlocationisslightlymisleading.id on ' tknowifisaresultofsomesortoflazyinitialiononononorsssssssleationg

sincethedatastringrepresentsajsonobjectandnotanarray,thisoperationisclearlyimpossible。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。