JSON parsing problem

前端 未结 4 385
臣服心动
臣服心动 2020-12-09 23:51

i am trying to Json parsing in my android app the link is https://www.buzzador.com/apps/present_software/webservice/index.php?op=ProductQ&campaign_id=607&userid=1077

4条回答
  •  北海茫月
    2020-12-10 00:53

    Had similar problem. At first my app was working great on both androids 4.0+ and 4.0- (2.3.3 2.2 etc). after a revision i have that problem. JSonarray could parse on 2.3.3

    PROBLEM: Json STRING (response from server) comes with a character ' in front so actual response= '[{"1":"omg"}] and not the correct one [{"1":"omg"}]

    Solution: if string dosent start with [ then edit response string (remove the ' character)

      if (result.startsWith("["))
          {
    
    
    
          }
          else
          {
              result= result.substring(1);
          }
    

    after then everything worked fine for me

提交回复
热议问题