title: When trying to retrieve JSONObject out of JSONArray is returning null?
body: <p>Im trying to do the following:</p>
  
  <pre><code>UserFunctions uf = new UserFunctions();
      JSONArray json = uf.getAllFreebies();
      System.out.println(json + "blah1"); //Here im able to retrieve the whole JSONArray.
  
  try{    
  System.out.println("1");
      for (int i = 1; i &lt;json.length(); i++) {
          System.out.println("2");
              jo = json.optJSONObject(i); //Im getting null value here
              System.out.println(jo + "blah2"); //Here im getting null
  </code></pre>
  
  <p>...}</p>
  
  <p>Im printing out my JSONArray using following lines. </p>
  
  <pre><code>JSONArray json = uf.getAllFreebies();
  System.out.println(json + "blah1"); 
  </code></pre>
  
  <p>Now on the following lines when i tried to retrieve the JSONObject from the JSONArray and tried to print it out,it prints out "null" instead of the JSONObject at the particular index.</p>
  
  <pre><code>jo = json.optJSONObject(i);
  System.out.println(jo + "blah2"); 
  </code></pre>
  
  <p>Can anyone pls tell me what am i doing wrong?I mean how can i get a null for JSONOBject when my JSONArray is not null?</p>
  
  <p>Thank You.</p>
  
  <p>Following is my JSONArray logcat:</p>
  
  <pre><code>05-31 21:02:57.156: I/System.out(318): [["viking","Art","Potrait","Potrait","Good","im giving out potrait 7325697","176 Fiat Ave","Iselin","New Jersey","USA","08830","2012-05-27"],["n00b","Books","Novels","Novels","Good","Im giving out novels 7325697","b9 maa krupa","petlad","Gujarat","India","388450","2012-05-27"],["n00b","Computers","laptop","laptop giveaway","Good","Im giving out laptop if you are interested than pls call on 7325697","B9 Ma  Krupa","Petlad","Gujarat","India","388450","2012-05-27"],["mista","Cameras &amp; Photos","Camera","Camera GiveAway","Very good","im giving out camera .its kodak .pls email me on mista@gmail.com","Mista Lee elm street","seoul","Korea","South Korea","ha8 9sd","2012-05-27"],["panda","Gaming Consoles","XBOX","XBOX 360","Very Good","Im giving out xbox 360.if you are interested please email me on panda@gmail.com","435 Carmen Rd,","Buffalo","New York","USA","14226","2012-05-27"],["viking","Cameras &amp; Photos","Camera","Kodak Camera","Good","Kodak Camera giveaway.Pls call on 732397","","Iselin","New Jersey","USA","08830","2012-05-28"],["viking","Books","Novels","Novel GA","Good","Novel give away.call on 7325697.","","Iselin","New Jersey","USA","08830","2012-05-28"],["viking","Automotive","Car","Car GiveAway","Good","Im giving out car.if you are interested pls call 7323697.","176 Fiat Ave","Iselin","New Jersey","USA","08830","2012-05-29"],["viking","Collectibles","Medallions","Medallion GA","Very Good","Im giving out medallion.if inetrested pls call 732697","176 Fiat Ave,","Iselin","New Jersey","USA","08830","2012-05-29"],["viking","Clothing &amp; Accessories","cloths","cloths giveaway","Good","im giving out cloths if you are interested pls call on 735697","176 Fiat Ave,","Iselin","New jersey","USA","08830","2012-05-29"],["viking","Books","Novel","Novel GA","Good","pls call 735697","435 carmen rd","buffalo","ny","usa","14226","2012-05-29"],["viking","Books","TextBook","CHemistry 101","GOod","pls call 735697","176 fiat ave","iselin","new jersey","usa","08830","2012-05-29"],["mista","Books","Notebook","Notbook","Good","im giving out notebbok if you are interested pls call 48374288423","elm street","seaoul","na","South Korea","jfjafjk","2012-05-29"]]blah1
  </code></pre>
  
  <p>logcat output when trying to print out JSONOBject at index i</p>
  
  <pre><code>05-31 21:02:57.156: I/System.out(318): nullblah2
  </code></pre>