Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 从JSON提要提取数据_Android_Json - Fatal编程技术网

Android 从JSON提要提取数据

Android 从JSON提要提取数据,android,json,Android,Json,有人能告诉我如何从以下JSON中获取标题和href属性吗 { "funding": [ { "FIELD1": "1", "FIELD2": "01/12/2016", "FIELD3": "<a title=\"SidQam\" href=\"http://www.sidqam.com/\">SidQam</a>", "FIELD4": "T

有人能告诉我如何从以下JSON中获取标题和href属性吗

{
 "funding": [ {
                "FIELD1": "1",
                "FIELD2": "01/12/2016",
                "FIELD3": "<a title=\"SidQam\" href=\"http://www.sidqam.com/\">SidQam</a>",
                "FIELD4": "Technology",
                "FIELD5": "Healthcare Software System",
                "FIELD6": "Noida",
                "FIELD7": "SQue Capital, Grace Capital Ventures, Soham Vencaps",
                "FIELD8": "Private Equity",
                "FIELD9": "1,200,000"
              }
            ]
}

你必须解析FIELD3属性..谢谢你的回复,但它没有帮助,而是我的应用程序在我写这篇文章时崩溃了。虽然在解析FIELD3值之前它工作得很好崩溃的堆栈跟踪是什么?@Coder its java.lang.StringIndexOutOfBoundsException我经历了什么。你能纠正它吗?它主要围绕子串形成。将这些索引值放入临时变量中,看看它们是否超出范围。是的,现在它起作用了。我在子字符串的形式中输入了错误。我写的是https而不是http。我想,我还需要在JSON提要中以有效格式写入http地址。无论如何,谢谢你的帮助。
JSONObject jsonObject = new JSONObject(jsonString);
JSONArray jsonArray = jsonObject.getJSONArray("funding");
String link = jsonArray.getString("FIELD3");
String href = link.substring(link.indexOf("http://"), link.indexOf("\">"));
//href must be clear link