Q:

Parsing JSON values inside an array android

this the JSON data that i want to parse in my application:
{
  "viewdeal":[
  {
     "viewdeal1":{
        "teetimeId":"33",
        "golfcourseId":"127",
        "offers":"descount of $2",
        "time":"8\/7\/pm",
        "amount":"90",
        "month":"august",
        "year":"2012",
        "date":"21",
        "day":"monday",
        "created_date":"0",
        "golfcourse_name":"SilverHorn Golf Club"
     },
     "msz":"Book"
   }
 ]
}

The code that i am using to parse the JSON data is:
JsonParser jParser = new JsonParser();
JSONObject json = jParser.getJSONfromUrl("http://mygogolfteetime.com/iphone/viewdeal/127");
JSONArray viewdeal = json.getJSONArray(TAG_VWDL);
                vwdlsList.clear();
                for(int i=0; i<viewdeal.length(); i++)
                {
                    JSONObject v1 = viewdeal.getJSONObject(i);
                    msz = v1.getString(TAG_MSZ);
                    viewdeal1 = v1.getString(TAG_VWDL1);
                    JSONArray viewdeal1 = json.getJSONArray(TAG_VWDL1); 
                    for(int j=0; j<viewdeal1.length(); j++)
                    {
                        JSONObject v2 = viewdeal.getJSONObject(j);
                        teetimeId = v2.getString(TAG_TTIMEID);
                        golfcourseId = v2.getString(TAG_GLFCRSID);
                        offers = v2.getString(TAG_OFR);
                        time = v2.getString(TAG_TIME);
                        amount = v2.getString(TAG_AMNT);
                        month = v2.getString(TAG_MNTH);
                        year = v2.getString(TAG_YEAR);
                        date = v2.getString(TAG_DATE);
                        day = v2.getString(TAG_DAY);
                        created_date = v2.getString(TAG_CRTDATE);
                        golfcourse_name = v2.getString(TAG_GLFCRSNAME);
                    }

                    HashMap<String, String> map = new HashMap<String, String>();
                    map.put(TAG_TTIMEID, teetimeId);
                    map.put(TAG_GLFCRSID, golfcourseId);
                    map.put(TAG_MSZ, msz);
                    map.put(TAG_OFR, offers);
                    map.put(TAG_TIME, time);
                    map.put(TAG_AMNT, amount);
                    map.put(TAG_MNTH, month);
                    map.put(TAG_YEAR, year);
                    map.put(TAG_DATE, date);
                    map.put(TAG_DAY, day);
                    map.put(TAG_CRTDATE, created_date);
                    map.put(TAG_GLFCRSNAME, golfcourse_name);

                    vwdlsList.add(map);
                }
            }

In the above code i am able to parse the value of msz and viewdeal1 but when i try to parse the remaining values that are in the viewdeal1 i receive the following message in my LogCat:
08-22 12:03:46.034: V/GoGolf(1178): org.json. JSONException: No value for viewdeal1

How can I parse the remaining values that are in the viewdeal1..
Thanks in advance..

A:

Try this...
nParser jParser = new JsonParser();
JSONObject json = jParser.getJSONfromUrl("http://mygogolfteetime.com/iphone/viewdeal/127");
JSONArray viewdeal = json.getJSONArray(TAG_VWDL);
                vwdlsList.clear();
                for(int i=0; i<viewdeal.length(); i++)
                {

             ---->> **JSONObject v1= viewdeal.getJSONObject(i).getJSONObject("viewdeal1");**

                         .....
                         .....      
                }

