0
我想顯示一個解析的JSON與我的價值觀。我的意思是,我想給json添加一些值並顯示它。我可以顯示所有響應的結果,但我想顯示只是JSON與我的價值觀並不是所有的數據:)如何把一個值提取JSON並顯示它
這裏我有媒體鏈接解析的json
的JSONObject的JSONObject =新的JSONObject(adresUrl);
JSONArray offerResources = jsonObject.getJSONArray("offerResources");
for(int y = 0; y < offerResources.length(); y++){
JSONObject currentTransfer = offerResources.getJSONObject(y);
JSONArray meetPoint = currentTransfer.getJSONArray("meetPoints");
for (int i = 0; i < meetPoint.length(); i++){
JSONObject currentMeetPoints = meetPoint.getJSONObject(i);
String startAddress = currentMeetPoints.getString("startAddress"); // here i wanna put some values , but i dont know how
//這裏是一個利特爾一塊的json :)
"meetPoints": [
{
"startAddress": "....", // after the collon i have to put my value .
"startLocation": {
感謝您的幫助
謝謝你迅速回答,但我搞砸了我的問題。我的意思是別的。我想要顯示我的json,但只是提取值。例如,在「startAddress」我有如下值:巴黎,紐約,柏林,如果用戶在startAddress「巴黎」寫入,則屏幕上應顯示json與價值巴黎。 –