how to work with asynctask in a loop?
<p>I am saving some data in a database using asynctask with a loop like this:</p>

<pre><code>for(int i=0;i&lt;5;i++){
new Loader().execute(i);
}
</code></pre>

<p>and in my asynctask class the doinbackground method is like this:</p>

<pre><code>@Override
        protected Void doInBackground(Integer... params) {
            db.insert(params[0]);
            return null;
        }
</code></pre>

<p>its being executed but everytime its inserting the first value of <code>i</code> in the database? how to work it with corresponding this loop?</p>
