Error parsing data org.json.JSONException: Value String cannot be converted to JSONArray

前端 未结 2 970
死守一世寂寞
死守一世寂寞 2021-01-29 06:41

Here is list activity.

List Activity:

public class ListDataActivity extends ListActivity {
@Override
protected void onCreate(Bundle save         


        
相关标签:
2条回答
  • 2021-01-29 06:57

    I dont know about php but If you are making API using Post Method, you should use httpPost rather than httpGet.

    0 讨论(0)
  • 2021-01-29 07:08

    As you said that you are unable to parse the json string which is like "'B-','O-'" but you can successfully parse the string like "B,O".

    It is due to the fact the single quote (') is considered as a special character for json and you may want to escape it like \' in your string before you parse it.

    For more details refer : How to escape special characters in building a JSON string?

    0 讨论(0)
提交回复
热议问题