title: How to Retrieve two or more json from multiple Url in MainActivity class Android
body: <p>I've made a <code>GetJSONTask</code> class which extend <code>AsynkTaskClass</code>. In the <code>onPostExecute</code> method I get the result if I pass single URL in <code>onCreate</code>. like</p>
  
  <pre><code> newCustomAsync().execute("http://abcd.com/fetch/Service1.svc/GetStates?"+
                      "CCode=" +country+ "");
  </code></pre>
  
  <p>I want to call multiple URL and retrieve multiple JSON in different variables.</p>
  
  <pre><code>private class CustomAsync extends AsyncTask&lt;String, Void, String&gt; {
  
      protected void onPreExecute() {
          super.onPreExecute(); 
       }  
      @Override
      protected String doInBackground(String... URL) {
  
              HttpClient Client = new DefaultHttpClient();
             try{
              String SetServerString = "";
              HttpGet httpget = new HttpGet(URL[0]);
              ResponseHandler&lt;String&gt; responseHandler =
              new BasicResponseHandler();
              SetServerString = Client.execute(httpget, responseHandler);
  
              JSONArray myListsAll= new JSONArray(SetServerString);
              for(int i=0;i&lt;myListsAll.length();i++){
                  JSONObject jsonobject= (JSONObject) myListsAll.get(i);
  
  
                   String states = jsonobject.optString("states");
                      }
                      return SetServerString;
              }catch(Exception e){}
          return null;
       }
  
         protected void onPostExecute(String result) {
              super.onPostExecute(result);
              JSONArray myListsAll = null;
              try {
                  myListsAll = new JSONArray(result);
              }   catch (JSONException e) {
  
                  e.printStackTrace();
              }
  
  
              JSONObject jsonobject= null;
              try {
                  jsonobject = (JSONObject) myListsAll.get(0);
              } catch (JSONException e) {
  
                  e.printStackTrace();
              }
  
             String msg =jsonobject.optString("states");
          }
   }
  </code></pre>