public void start(ProcessButton button,Activity activity) { activity.RunOnUiThread (() => { action = ()=> UpdateProgress(button,0); messageHandler.PostDelayed(action,generateDelay()); }); }
void UpdateProgress(ProcessButton button,int progress){ mProgress += 10; button.setProgress(mProgress); if (mProgress < 100) { Console.WriteLine("Progress "+mProgress); action = ()=> UpdateProgress(button,mProgress); messageHandler.PostDelayed(action, generateDelay()); } else { mListener.onComplete(); Console.WriteLine("Progress Completed "+mProgress); } }