In my app i'm displaying a list with a checkbox for each item. when user clicks on a button my app should import each checked item(Contact) to contacts app. i am trying to show the user the progress(ItemIndex/TotalItems) + text of the current item (by using progress dialog). Meanwhile my app is checking for each item (contact) it is already exist in the contacts app, and if so, a dialog will be displayed (this dialog is an activity - dialog themed) by using stratActivityForResult. I've tried to use asynctask and all it does is to show a progress dialog with the first item and nothing more. I also tried to use handler and it does the same thing.
can anyone help me?
EDIT:
int filesIndex=0;
ArrayList selectedFiles<String>;
startImport();
private void StartImport(final ArrayList<String> Files)
{
//checks if there's allready an existing item and if there is, call displayConflict();
}
private void displayConflict(String file1, String file2)
{
startActivityForResult....//call an activity that looks like a dialog....
}
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
//use data....
operate();//addnew / update / skip
MoveNext();
}
protected void Movenext()
{
filesIndex++; //------------> this is the step where I want to update ui with progressDialog....
StartImport();
}