Progress Dialog with For Loop
<p>How can I use Progress Dialog box with for Loop.</p>

<p>Means either inside the loop or outside the loop wherever it's possible.
Currently I'm trying to use loop inside the progress dialog with it's not working.</p>

<pre><code>for (int i = 0; i &lt; 4; i++) {
    param = filename + "|" + String.valueOf(Outlet) + "|" + String.valueOf(UserId) + "|" + remarks + "|" + String.valueOf(rowid) + "|" + String.valueOf(ReportId);
    final String params = param;
    try {
        result = connectFTP();
        if (!result) {
            dbase.DeleteAlbum(rowid);
            Toast.makeText(this, "Record not uploaded.. Try Again..", Toast.LENGTH_LONG).show();
            handler.sendEmptyMessage(0);
            return;
        }
        if (result) {
            result = wcf.InsertAlbum(params);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
</code></pre>
