I get all the data from the server using doInBackground () as shown below.
class DataLoader extends Activity{ public void onCreate() { ............................... new AsyncTask1().execute(); } class AsyncTask1 extends AsyncTask<String, String, String> { @Override protected void onPreExecute() { super.onPreExecute(); progressDialog = new ProgressDialog(DataLoader.this); progressDialog.setMessage("Loading..."); progressDialog.setCancelable(false); progressDialog.show(); } protected String doInBackground(String... args) { JSONObject json; List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("param1",datafield1)); params.add(new BasicNameValuePair("param2",datafield2)); json = jsonParser.makeHttpRequest(url, "POST", params); try { int success = json.getInt(SUCCESS); if (success == 1) { products = json.getJSONArray(PRODUCTS);
According to the code above, I set the data in listview in the onPostExecute() method only after loading all the data. But now I want to implement the CW Endless Adapter with real code, but since I'm new to this, I cannot figure out how to move on from here. I included the jar file CWAdapter in the libs folder. They took this and searched a lot, but did not use it. Can someone please help me implement an infinite function for the data I receive?
source share