title: How to parse Inner json objects arrays
body: <p>I am working with the ESPN Sports API. Can any one help me how to parse this?</p>
  
  <p>I am pasting my code, I am able to parse only the name and id&ndash;please help how to parse inner objects items.</p>
  
  <pre><code>public class BaseballActivity extends ListActivity{
  
  private static String url = "http://api.espn.com/v1/sports/baseball?apikey=h29yphwtf7893hktfbn7cd5g";
  
  private static final String TAG_SPORTS = "sports";
  private static final String TAG_ID = "id";
  private static final String TAG_TIMESTAMP = "timestamp";
  private static final String TAG_NAME = "name";
  private static final String TAG_NEWS = "news";
  private static final String TAG_HEADLINES = "headlines";
  private static final String TAG_LINKS = "links";
  private static final String TAG_API = "api";
  private static final String TAG_SPORTS1 = "sports";
  private static final String TAG_HREF = "href";
  
  JSONArray sports = null;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
  
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      // HashMap for ListView
  
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; sportsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
      // creating Json parser instance
      JSONParser jParser = new JSONParser();
  
      // getting Json String from url
  
      JSONObject json = jParser.getJSONFromUrl(url);
  
      try{
          // Getting Array of Contacts
                      sports = json.getJSONArray(TAG_SPORTS);
  
                      // looping through All Contacts
                      for(int i = 0; i &lt; sports.length(); i++){
                          JSONObject c = sports.getJSONObject(i);
  
  
              //String news = c.getString(TAG_NEWS);
             // String headlines = c.getString(TAG_HEADLINES);
              String name = c.getString(TAG_NAME);
             // String timestamp = c.getString(TAG_TIMESTAMP);
              String id = c.getString(TAG_ID);
  
           //   JSONObject links = c.getJSONObject(TAG_LINKS);
            //  JSONObject api = c.getJSONObject(TAG_API);
            //  JSONObject sports = c.getJSONObject(TAG_SPORTS1);
  
           //   String href = c.getString(TAG_HREF);
  
  
  
              HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
           //  map.put(TAG_TIMESTAMP, timestamp);
              map.put(TAG_NAME, name);
             // map.put(TAG_NEWS, news);
             // map.put(TAG_HEADLINES, headlines);
              map.put(TAG_ID, id);
           //   map.put(TAG_HREF, href);
              sportsList.add(map);
           }
      }
          catch (JSONException e) {
              e.printStackTrace();    
  
          }
  
  
      ListAdapter adapter = new SimpleAdapter(this, sportsList,
              R.layout.list_item,
              new String[]{TAG_NAME,TAG_ID} , new int[] {
              R.id.id,R.id.name});
  
     setListAdapter(adapter);   
   }
  }
  </code></pre>
  
  <p>here is my link I am using</p>
  
  <p><a href="http://api.espn.com/v1/sports/baseball?apikey=h29yphwtf7893hktfbn7cd5g" rel="nofollow">Sample Link</a>  </p>