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

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

Here is list activity.

List Activity:

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


        
2条回答
  •  猫巷女王i
    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?

提交回复
热议问题