Asynctask skips some value of for loop
<p>I have to hit a webservice for the selected checkbox one by one so i am doing that using a for loop. But sometimes the webservice is called for total number of checked values but sometime it skips the execution for last 1,2 or three check box which are checked by the user. What we can do to resolve this issue ? Please have a look at the code.</p>

<pre><code>for (int i = 0; i &lt; count; i++) {
                    f = (FollowTypeData) mLvfollow.getAdapter().getItem(i);
                    if (f.isIschecked()) {
                        s = true;
                    }
                }

for (int ind = 0; ind &lt; count; ind++) {

                        if (check) {
                            Log.e("checked value", ""+check);
                        } else {
                            f = (FollowTypeData) mLvfollow.getAdapter().getItem(ind);
                            if (f.isIschecked()) {
                                String values[] = { f.getId(), f.getType(),
                                        f.getIsfollowed() };
                                try {
                                    new FollowDeals().execute(values).get();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                } catch (ExecutionException e) {
                                    e.printStackTrace();
                                }
                                m_id.add("" + f);
                            }
                        }

                    }
</code></pre>

<p>AsyncTask</p>

<pre><code>public class FollowDeals extends AsyncTask&lt;String, Void, String&gt; {
        @Override
        protected String doInBackground(String... params) {

            String followdata = "";
            String result = "";
            result = followdealData(params[0], params[1], params[2]);

            return followdata;
        }
}
</code></pre>
