title: Json parser get value outside for doInBackground
body: <p>I have a Json parser and <code>doInBackground</code> for loading more result. My json contain "name", "image" and, "nextpage" details. "nextpage" is a url link for parse again in <code>doInBackground</code> for more result.. How can I get "nextpage" link in to my doInBackground?</p>
  
  <pre><code>private String next = "first url";
  private String url ="myurl
   public List&lt;Item&gt; getData(String url) {
  
          try {
  
              listArray = new ArrayList&lt;Item&gt;();
              HttpGet httppost = new HttpGet(url);
              HttpClient httpclient = new DefaultHttpClient();
              HttpResponse response = httpclient.execute(httppost);
              int status = response.getStatusLine().getStatusCode();
  
              HttpEntity entity = response.getEntity();
              String data = EntityUtils.toString(entity);
  
  
              JSONObject jsono = new JSONObject(data);
              JSONArray jarray = jsono.getJSONArray("data");
              JSONObject page = jsono.getJSONObject("page");
  
  
              for (int i = 0; i &lt; jarray.length(); i++) {
                  JSONObject object = jarray.getJSONObject(i);
  
                      objItem = new Item();
  
                      next = page.getString("nextpage");
                      objItem.setNext(next);
  
                      objItem.setTitle(object.getString("name"));
                      objItem.setLink(object.getString("image"));
  
  
                      listArray.add(objItem);
  
               }
  
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          return listArray;
      }
  
  
  
      @Override
  public void onScroll(AbsListView view, int firstVisibleItem,
          int visibleItemCount, int totalItemCount) {
      int loadedItems = firstVisibleItem + visibleItemCount;
      if ((loadedItems == totalItemCount) &amp;&amp; !isloading) {
          if (task != null &amp;&amp; (task.getStatus() == AsyncTask.Status.FINISHED)) {
              if (hasMore) {
                  url = next;
                  task = new MyTask();
                  task.execute();
              }
  
          }
      }
  </code></pre>