Running a ProgressDialog MonoAndroid

Posted by user1791926 on Stack Overflow See other posts from Stack Overflow or by user1791926
Published on 2012-11-01T16:24:34Z Indexed on 2012/11/01 17:00 UTC
Read the original article Hit count: 158

I am trying to run a progressDialog that will loading items into a Sqlite datebase on a first load for my application. I get an error message because the application runs the rest of the code in the application before the rest of the data is loaded into the database.

How do I make sure the code is completed in the progressDialog before the code in the rest of the program?

LocalDatabase DB = new LocalDatabase();
var dbpd = ProgressDialog.Show(this, "Loading Database", "Please wait Loading Data",true);
ThreadPool.QueueUserWorkItem((s) =>{
DB.createDB();
RunOnUiThread(() => databaseLoaded());
});

© Stack Overflow or respective owner

Related posts about android

Related posts about monodroid