【问题标题】:W/System.err(421): org.json.JSONException: End of input at character 0 of [duplicate]W/System.err(421): org.json.JSONException: [重复] 字符 0 处的输入结束
【发布时间】:2013-04-02 03:34:32
【问题描述】:
this code error:
04-02 03:01:52.552: I/params(421): [name=aad, category_id=0]
04-02 03:01:52.552: E/Log(421): Failed to download result..
04-02 03:01:52.552: W/System.err(421): org.json.JSONException: End of input at character 0 of 
04-02 03:01:52.552: W/System.err(421):  at org.json.JSONTokener.syntaxError(JSONTokener.java:446)
04-02 03:01:52.562: W/System.err(421):  at org.json.JSONTokener.nextValue(JSONTokener.java:93)
04-02 03:01:52.562: W/System.err(421):  at org.json.JSONObject.<init>(JSONObject.java:154)
04-02 03:01:52.562: W/System.err(421):  at org.json.JSONObject.<init>(JSONObject.java:171)
04-02 03:01:52.562: W/System.err(421):  at com.gift2u.products.ListProduct.onCreate(ListProduct.java:94

如果我给参数 [name=, category_id=0] 所有编程运行正常 我编写程序搜索过滤器 product_name 或 category_id。 谢谢大家的回答

【问题讨论】:

    标签: android


    【解决方案1】:

    您的 Json 字符串格式错误。

    将 [ ... ] 替换为 { ... }。

    [ ] 是一个 json 数组,不是 json 对象。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多