AlertDialog disappearing while another methods have been executed

I have the following method:

private void ImportAllXMLFilesIntoDatabase(object sender, EventArgs e)
{
    AlertDialog.Builder alertImportingData = new AlertDialog.Builder(this);
    alertImportingData.SetMessage("Importing data...");
    Dialog dialogImportingData = alertImportingData.Create();
    dialogImportingData.Show();

    string apkFolder = FilesDir.Path;
    string pathFromserverFolder = apkFolder + "/backup/fromserver";

   ImportXMLFileIntoDatabase<Article, Articles>(pathFromserverFolder,"articles.xml", apkFolder,"articles");
   ImportXMLFileIntoDatabase<Customer, Customers>(pathFromserverFolder, "customers.xml", apkFolder, "customers");
   ImportXMLFileIntoDatabase<Sertif, Sertifs>(pathFromserverFolder, "sertif.xml", apkFolder, "sertificates");
}

The problem is dialogImportingData is showing on screen only after all ImportXMLFileIntoDatabase have been executed. Is there any way to solve that problem? I'm using Xamarin.Android(C#).

Sign In or Register to comment.